We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9484c1c commit 8136472Copy full SHA for 8136472
src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Controls/Slider.cs
@@ -1189,6 +1189,11 @@ private double SnapToTick(double value)
1189
value = DoubleUtil.GreaterThanOrClose(value, (previous + next) * 0.5) ? next : previous;
1190
}
1191
1192
+ // Normalize floating-point rounding errors introduced by
1193
+ // repeated tick arithmetic (e.g. 0.1 + 0.2 ≠ 0.3 exactly in IEEE-754).
1194
+ // This prevents visual artifacts like 1.1312000000000002.
1195
+ value = Math.Round(value, 10);
1196
+
1197
return value;
1198
1199
0 commit comments