mirror of
https://github.com/libretro/RetroArch.git
synced 2026-11-07 08:36:02 -10:00
(Menu) Snap a stepped float to its minimum too
The left action of a float setting now snaps a value within half a step of an enforced minimum to it, as the right action does at the maximum. Five 0.001 steps down from 0.005 land at -7e-10, which prints as -0.000 and is stored as such; they land at 0 now.
This commit is contained in:
1 parent
2323c32574
commit
e0cb387db7
1 file changed
+5
@@ -1174,6 +1174,11 @@ static int setting_fraction_action_left_default(
|
||||
else
|
||||
*setting->value.target.fraction = min;
|
||||
}
|
||||
/* Within half a step of the minimum is the minimum: the steps
|
||||
* that led here were each a float subtraction, and what lands
|
||||
* a few ulps under 0 prints as -0.000 and is stored as such. */
|
||||
else if (*setting->value.target.fraction < min + half_step)
|
||||
*setting->value.target.fraction = min;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
Reference in new issue
Block a user