-
Notifications
You must be signed in to change notification settings - Fork 1.3k
WPF - slider precision is not correct. #8819
Copy link
Copy link
Open
Labels
🚧 work in progressGood First Issuemetadata: Issue should be easy to implement, good for first-time contributorsmetadata: Issue should be easy to implement, good for first-time contributorsInvestigateRequires further investigation by the WPF team.Requires further investigation by the WPF team.help wanted[up-for-grabs] Good issue for external contributors[up-for-grabs] Good issue for external contributors
Metadata
Metadata
Assignees
Labels
🚧 work in progressGood First Issuemetadata: Issue should be easy to implement, good for first-time contributorsmetadata: Issue should be easy to implement, good for first-time contributorsInvestigateRequires further investigation by the WPF team.Requires further investigation by the WPF team.help wanted[up-for-grabs] Good issue for external contributors[up-for-grabs] Good issue for external contributors
Type
Fields
Give feedbackNo fields configured for issues without a type.
Description
Hello,
we use slider with this configuration
Gamma.Minimum is 0.5.
Gamma.Maximum is 4.
Gamma.Value is bounded.
All properties are
double.Problem is that when Value is
1.9and i move slider very little then value does not change to2or1.8but it changes to1.9000000000000001which is not correct. Value should be2.I have tried to debug it and I think that I have found problem at this line
wpf/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Controls/Slider.cs
Line 1135 in 2fdb74d
When
* TickFrequencyis used value result of multiplication brings precision problem.Part of the code from the link above.
Reproduction Steps
Add Slider with binding to double value
Set value to
1.9from code.Try to move slidre a little. See problem.
Expected behavior
2.0Actual behavior
Value is set to
1.9000000000000001.Regression?
No response
Known Workarounds
No response
Impact
No response
Configuration
No response
Other information
No response