godotengine / godotengine/godot

Minimum value `0.0001` in `hintString` for `Export` property with `PropertyHint.Range` shown as `0` in Editor

Open
#97,617 4 comments 0 reactions 0 assignees View on GitHub
discussion topic:editor usability
Dominant language
C++
Stars
117k
Forks
26.8k
PR merge metrics
PR metrics pending

Description

### Tested versions

- Reproducible in: `v4.3.stable.mono.arch_linux`

### System information

Godot v4.3.stable.mono unknown - Garuda Linux #1 SMP PREEMPT_DYNAMIC Fri, 20 Sep 2024 09:23:13 +0000 - Wayland - Vulkan (Forward+) - dedicated AMD Radeon RX 6950 XT (RADV NAVI21) - AMD Ryzen 7 3800X 8-Core Processor (16 Threads)

### Issue description

`Export` property in C# Resource class with `hintString = "0.0001,1,or_greater"` and `PropertyHint.Range`, when setup to the minimum allowed value (`0.0001`), displayed in Editor as `0`, while still displaying correct value when hovering on the field.

![Screenshot_1](https://github.com/user-attachments/assets/ee44d3b0-a0fb-4aab-94c7-4c1de4e41896)

When the minimum value in `hintString` is set to `0.001` - now it displayed correctly in the Editor.

### Steps to reproduce

1. Create a custom Resource class in C#.
2. Add code `[Export(PropertyHint.Range, "0.0001,1,or_greater")] public float MyValue { get; private set; }`.
3. Compile code.
4. Create a new Resource asset and assign a newly created custom Resource class as a script to it.

### Minimal reproduction project (MRP)

[firearms.zip](https://github.com/user-attachments/files/17179285/firearms.zip)

Contributor guide

Open the contributing guide

Research direction

Start with the firearms.zip minimal reproduction project and reproduce the C# Resource property using [Export(PropertyHint.Range, "0.0001,1,or_greater")]. Inspect the Editor handling for PropertyHint.Range values and compare the displayed field with its hover value. Done means the minimum value 0.0001 is displayed correctly rather than rounded to 0, while the existing reproduction steps still work.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.