diff options
author | Jaehyun Cho <jae_hyun.cho@samsung.com> | 2019-04-24 14:44:50 +0900 |
---|---|---|
committer | Jaehyun Cho <jae_hyun.cho@samsung.com> | 2019-04-24 14:44:50 +0900 |
commit | 1bdb278f5c56bfbc3421055323f111ee3a5335fd (patch) | |
tree | 1f7e9309917e4ec94eeaa8e7f7f4cdcd4756a12c | |
parent | cf4854effbc94c53c25365ec4a3d794dff97c16b (diff) | |
download | efl-1bdb278f5c56bfbc3421055323f111ee3a5335fd.tar.gz |
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.
-rw-r--r-- | src/lib/evas/canvas/efl_canvas_animation_player.c | 8 |
1 files 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 677443a5f5..063f932d49 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. |