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:
Cedric BAIL 2012-07-28 13:29:50 +00:00
parent 2d35ea7985
commit 74ecff49ec
2 changed files with 10 additions and 1 deletions

View File

@ -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>

View File

@ -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);