From fcf19d8d203b0ebfc1d334b915e3f0a9b70d458b Mon Sep 17 00:00:00 2001 From: Jaehyun Cho Date: Wed, 24 Apr 2019 14:44:50 +0900 Subject: [PATCH] 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. Change-Id: I0656540589492d68b3fb61ef8eb25faadf3f4011 --- src/lib/evas/canvas/efl_canvas_animation_player.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/lib/evas/canvas/efl_canvas_animation_player.c b/src/lib/evas/canvas/efl_canvas_animation_player.c index 677443a..063f932 100644 --- a/src/lib/evas/canvas/efl_canvas_animation_player.c +++ b/src/lib/evas/canvas/efl_canvas_animation_player.c @@ -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. -- 2.7.4