jaehyun pushed a commit to branch master.

http://git.enlightenment.org/core/elementary.git/commit/?id=9b2aa79f81b5df3859224cee671f25927b26bc4a

commit 9b2aa79f81b5df3859224cee671f25927b26bc4a
Author: Jee-Yong Um <jc9...@samsung.com>
Date:   Thu Jan 28 18:12:30 2016 +0900

    elm_focus: fix mislocation error during continuous focus movement
    
    Summary:
    When focus is moved fast and continuously, newly created animator
    conflicts with the animator for previous movement, so focus bounces
    among locations.
    This patch removes previous animator and move focus to the final
    location before creating new animator.
    
    Test Plan:
    elementary_test -to focus
    elementary_test -to genlist
    
    Reviewers: raster, jpeg, cedric, Jaehyun_Cho
    
    Differential Revision: https://phab.enlightenment.org/D3611
---
 data/themes/edc/elm/focus.edc | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/data/themes/edc/elm/focus.edc b/data/themes/edc/elm/focus.edc
index f4da05f..c080505 100644
--- a/data/themes/edc/elm/focus.edc
+++ b/data/themes/edc/elm/focus.edc
@@ -5,6 +5,7 @@ group { name: "elm/focus_highlight/top/default";
    script {
       public s_x, s_y, s_w, s_h; /* source */
       public difx, dify, difw, difh;
+      public g_anim_id;
       
       public animator1(val, Float:pos) {
          new x, y, w, h, dx, dy, dw, dh, Float:p;
@@ -18,6 +19,10 @@ group { name: "elm/focus_highlight/top/default";
          dh = round(float_mul(float(get_int(difh)), p));
          h = get_int(s_h) + dh;
          update_offset(x, y, w, h);
+
+         if (pos >= 1.0) {
+            set_int(g_anim_id, 0);
+         }
       }
       
       public update_offset(x, y, w, h) {
@@ -28,7 +33,14 @@ group { name: "elm/focus_highlight/top/default";
       public message(Msg_Type:type, id, ...) {
          if ((type == MSG_INT_SET) && (id == 1)) {
             new x1, y1, w1, h1, x2, y2, w2, h2;
+            new anim_id;
             
+            anim_id = get_int(g_anim_id);
+            if (anim_id != 0) {
+               cancel_anim(anim_id);
+               animator1(1, 1.0);
+            }
+
             x1 = getarg(2);
             y1 = getarg(3);
             w1 = getarg(4);
@@ -53,7 +65,8 @@ group { name: "elm/focus_highlight/top/default";
             update_offset(x1, y1, w1, h1);
             set_state(PART:"base", "custom", 0.0);
             
-            anim(0.2, "animator1", 1);
+            anim_id = anim(0.2, "animator1", 1);
+            set_int(g_anim_id, anim_id);
          }
       }
    }

-- 


Reply via email to