Fraction setting wraparound rounding correction (#15676)

This commit is contained in:
sonninnos 2023-09-06 04:14:04 +03:00 committed by GitHub
parent bef29c466b
commit 0eeb9f918e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1083,8 +1083,9 @@ static int setting_fraction_action_left_default(
if (setting->flags & SD_FLAG_ENFORCE_MINRANGE)
{
float min = setting->min;
if (*setting->value.target.fraction < min)
float min = setting->min;
float half_step = setting->step * 0.5f;
if (*setting->value.target.fraction < min - half_step)
{
settings_t *settings = config_get_ptr();
float max = setting->max;