forked from enlightenment/efl
slider: compare slider values elaborately.
because of the double type nature, the comparison is not correct. we decide the value changes with range of double epsilon to avoid this. @fix
This commit is contained in:
parent
f8662bc2a0
commit
560c3cd8fe
|
@ -89,7 +89,7 @@ _val_fetch(Evas_Object *obj, Eina_Bool user_event)
|
|||
pos = 1.0 - pos;
|
||||
|
||||
val = (pos * (sd->val_max - sd->val_min)) + sd->val_min;
|
||||
if (val != sd->val)
|
||||
if (fabs(val - sd->val) > DBL_EPSILON)
|
||||
{
|
||||
sd->val = val;
|
||||
if (user_event)
|
||||
|
|
Loading…
Reference in New Issue