forked from enlightenment/efl
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
This commit is contained in:
parent
2d35ea7985
commit
74ecff49ec
|
@ -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>
|
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue