diff options
author | Jee-Yong Um <jc9.um@samsung.com> | 2016-01-28 18:12:30 +0900 |
---|---|---|
committer | Jaehyun Cho <jae_hyun.cho@samsung.com> | 2016-01-28 18:12:30 +0900 |
commit | 9b2aa79f81b5df3859224cee671f25927b26bc4a (patch) | |
tree | 33c4cdece24c9cf0bbc08417915f5fc69a2cba5d | |
parent | b4739f5323a973a7b752b6cd10019aeb8dd61d6e (diff) | |
download | elementary-9b2aa79f81b5df3859224cee671f25927b26bc4a.tar.gz |
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
-rw-r--r-- | data/themes/edc/elm/focus.edc | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/data/themes/edc/elm/focus.edc b/data/themes/edc/elm/focus.edc index f4da05f28..c080505d2 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); } } } |