forked from enlightenment/efl
efl_canvas_animation_player: fix to apply animation when player starts
Previously, animation was not applied immediately when player starts animation because elapsed time is 0. This caused flickering object if animation begins with alpha 0 because the alpha 0 animation is not applied immediately. Now, animation is applied immediately when player start animation.
This commit is contained in:
parent
cf4854effb
commit
1bdb278f5c
|
@ -84,8 +84,12 @@ _animator_cb(void *data)
|
|||
duration = efl_animation_duration_get(anim);
|
||||
elapsed_time = pd->time.current - pd->time.prev;
|
||||
vector = elapsed_time / duration;
|
||||
|
||||
if (vector <= DBL_EPSILON)
|
||||
|
||||
/* When animation player starts, _animator_cb() is called immediately so
|
||||
* both elapsed time and progress are 0.0.
|
||||
* Since it is the beginning of the animation if progress is 0.0, the
|
||||
* following codes for animation should be executed. */
|
||||
if ((vector <= DBL_EPSILON) && (pd->progress != 0.0))
|
||||
return ECORE_CALLBACK_RENEW; // There is no update.
|
||||
|
||||
//TODO: check negative play_speed.
|
||||
|
|
Loading…
Reference in New Issue