summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2020-01-02 14:05:41 -0500
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2020-01-13 15:57:20 +0100
commitb6ea86497000a907c964586dc771d0c2077c1652 (patch)
tree46c28ebbaa2cf4593c8fab3dc2eb110538a69b7a
parentbbdab35a7a911859c2f6ed2e110c5f81d7455f4e (diff)
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
-rw-r--r--src/lib/elementary/efl_ui_spin_button.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/lib/elementary/efl_ui_spin_button.c b/src/lib/elementary/efl_ui_spin_button.c
index 514272fae4..6dc0dbe897 100644
--- a/src/lib/elementary/efl_ui_spin_button.c
+++ b/src/lib/elementary/efl_ui_spin_button.c
@@ -405,10 +405,11 @@ static void
405_spin_value(Efl_Ui_Spin *obj, Eina_Bool inc) 405_spin_value(Efl_Ui_Spin *obj, Eina_Bool inc)
406{ 406{
407 Efl_Ui_Spin_Button_Data *pd = efl_data_scope_get(obj, EFL_UI_SPIN_BUTTON_CLASS); 407 Efl_Ui_Spin_Button_Data *pd = efl_data_scope_get(obj, EFL_UI_SPIN_BUTTON_CLASS);
408 double val = efl_ui_range_value_get(obj);
409 double step = inc ? pd->step : -pd->step;
408 410
409 double absolut_value = efl_ui_range_value_get(obj) + (inc ? pd->step : -pd->step); 411 /* clamp to step before setting new value */
410 412 _value_set(obj, round((val + step) / step) * step);
411 _value_set(obj, absolut_value);
412} 413}
413 414
414static void 415static void