summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaehyun Cho <jae_hyun.cho@samsung.com>2019-04-24 14:44:50 +0900
committerJaehyun Cho <jae_hyun.cho@samsung.com>2019-04-24 14:44:50 +0900
commit1bdb278f5c56bfbc3421055323f111ee3a5335fd (patch)
tree1f7e9309917e4ec94eeaa8e7f7f4cdcd4756a12c
parentcf4854effbc94c53c25365ec4a3d794dff97c16b (diff)
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.c8
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)
84 duration = efl_animation_duration_get(anim); 84 duration = efl_animation_duration_get(anim);
85 elapsed_time = pd->time.current - pd->time.prev; 85 elapsed_time = pd->time.current - pd->time.prev;
86 vector = elapsed_time / duration; 86 vector = elapsed_time / duration;
87 87
88 if (vector <= DBL_EPSILON) 88 /* When animation player starts, _animator_cb() is called immediately so
89 * both elapsed time and progress are 0.0.
90 * Since it is the beginning of the animation if progress is 0.0, the
91 * following codes for animation should be executed. */
92 if ((vector <= DBL_EPSILON) && (pd->progress != 0.0))
89 return ECORE_CALLBACK_RENEW; // There is no update. 93 return ECORE_CALLBACK_RENEW; // There is no update.
90 94
91 //TODO: check negative play_speed. 95 //TODO: check negative play_speed.