efl_ui/spin_button: fix step clamping

values for this needs to be rounded off the step in order to be expected
step-values and not just double garbage

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D11006
This commit is contained in:
Mike Blumenkrantz 2020-01-02 14:05:41 -05:00 committed by Marcel Hollerbach
parent bbdab35a7a
commit b6ea864970
1 changed files with 4 additions and 3 deletions

View File

@ -405,10 +405,11 @@ static void
_spin_value(Efl_Ui_Spin *obj, Eina_Bool inc)
{
Efl_Ui_Spin_Button_Data *pd = efl_data_scope_get(obj, EFL_UI_SPIN_BUTTON_CLASS);
double val = efl_ui_range_value_get(obj);
double step = inc ? pd->step : -pd->step;
double absolut_value = efl_ui_range_value_get(obj) + (inc ? pd->step : -pd->step);
_value_set(obj, absolut_value);
/* clamp to step before setting new value */
_value_set(obj, round((val + step) / step) * step);
}
static void