From: Umesh Tanwar Date: Tue, 14 Mar 2017 08:54:16 +0000 (+0530) Subject: ecore_animator: improve comparision check for stopping animator. X-Git-Tag: upstream/1.20.0~1702 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b938e2b5d873a98bad608e6856417d0bbabbbfc3;p=platform%2Fupstream%2Fefl.git ecore_animator: improve comparision check for stopping animator. Summary: Time cmparision does not ensure the corrctness of posotion. It is beacuse of double number calculation. Double number calculation are not convertable.for example: 1/39 = 0.02564102564; but 0.02564102564 * 39 = 0.99999999996 != 1; The addition check for pos ensure the pos to be reached at its correct position. @fix Signed-off-by: Umesh Tanwar Reviewers: cedric, singh.amitesh, jpeg, raster Reviewed By: raster Subscribers: atulfokk, cedric, jpeg Differential Revision: https://phab.enlightenment.org/D4709 Signed-off-by: Amitesh Singh --- diff --git a/src/lib/ecore/ecore_anim.c b/src/lib/ecore/ecore_anim.c index 461d035..84e31e1 100644 --- a/src/lib/ecore/ecore_anim.c +++ b/src/lib/ecore/ecore_anim.c @@ -983,7 +983,7 @@ _ecore_animator_run(void *data) pos = 0.0; } run_ret = animator->run_func(animator->run_data, pos); - if (t >= (animator->start + animator->run)) run_ret = EINA_FALSE; + if (t >= (animator->start + animator->run) && (pos >= 1.0)) run_ret = EINA_FALSE; return run_ret; }