diff options
author | Cedric BAIL <cedric.bail@free.fr> | 2012-07-28 13:29:50 +0000 |
---|---|---|
committer | Cedric BAIL <cedric.bail@free.fr> | 2012-07-28 13:29:50 +0000 |
commit | 81db2b7921524934bce27aac3b384daf885c8464 (patch) | |
tree | db98be7082447f07d6e0700d77e8688b18eb1993 | |
parent | 0b2dabae9c54c1c495456ad08ad90cc1b55c7b48 (diff) | |
download | elementary-81db2b7921524934bce27aac3b384daf885c8464.tar.gz |
elementary: round up the spinning speed when the step is too small with a warning message.
Patch by Jean-Philippe André <jpeg@videolan.org>
SVN revision: 74528
-rw-r--r-- | AUTHORS | 1 | ||||
-rw-r--r-- | src/lib/elm_spinner.c | 10 |
2 files changed, 10 insertions, 1 deletions
@@ -61,3 +61,4 @@ Michal Pakula vel Rutka <m.pakula@samsung.com> Thiep Ha <thiep.ha@samsung.com> Artem Popov <artem.popov@samsung.com> Minseok Kim <minseok3.kim@samsung.com> +Jean-Philippe André <jpeg@videolan.org>
\ No newline at end of file diff --git a/src/lib/elm_spinner.c b/src/lib/elm_spinner.c index 3c276ab06..7abbce3aa 100644 --- a/src/lib/elm_spinner.c +++ b/src/lib/elm_spinner.c @@ -325,8 +325,16 @@ static Eina_Bool _spin_value(void *data) { ELM_SPINNER_DATA_GET(data, sd); + double real_speed = sd->spin_speed; - if (_value_set(data, sd->val + sd->spin_speed)) _label_write(data); + /* Sanity check: our step size should be at least as large as our rounding value */ + if ((sd->spin_speed != 0.0) && (abs(sd->spin_speed) < sd->round)) + { + WRN("The spinning step is smaller than the rounding value, please check your code"); + real_speed = sd->spin_speed > 0 ? sd->round : -sd->round; + } + + if (_value_set(data, sd->val + real_speed)) _label_write(data); sd->interval = sd->interval / 1.05; ecore_timer_interval_set(sd->spin, sd->interval); |