Fix: Add locale-independent number parsing for all input methods (#2082)#2083
Open
ikonnow wants to merge 2 commits into
Open
Fix: Add locale-independent number parsing for all input methods (#2082)#2083ikonnow wants to merge 2 commits into
ikonnow wants to merge 2 commits into
Conversation
0084ced to
e927a27
Compare
Author
|
Updated the PR description to also include issue #2084 — the branch now contains two related fixes:
I’ve also reduced the commit history from 7 confusing commits to 2 clear ones to make it easier to review. |
e927a27 to
d288155
Compare
Author
|
Rebased onto latest upstream
|
7622dc9 to
5abff82
Compare
5abff82 to
8d42090
Compare
8d42090 to
eccf83d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes issue #2082 and #2084.
#2082: Locale-independent float parsing
When users enter comma-separated decimal values (e.g., "1,5") in locales where comma is the decimal separator, the application incorrectly parses these values, leading to:
Solution
Replace commas with dots before parsing floats in all input methods:
Modified files:
parse_float()functionui_slider()function (both WITH_EVAL and non-WITH_EVAL paths)ui_float_input()function.3,.5f)#2084: Clamp opacity to [0,1] range
Opacity values could drift outside the valid [0,1] range through the UI and rendering pipeline, causing visual artifacts.
Solution
Clamp opacity after slider input and in uniform reads:
Modified files:
paint/sources/nodes_brush/brush_output_node.cpaint/sources/ui/tab_layers.cpaint/sources/ui/tab_swatches.cpaint/sources/ui/ui_header.cpaint/sources/uniforms.cTesting