From 66a6b88bbca238bed10b25646dbd6a5da8130281 Mon Sep 17 00:00:00 2001 From: discomfitor Date: Mon, 5 Dec 2011 04:32:37 +0000 Subject: [PATCH] From: Hyoyoung Chang Subject: [E-devel] [patch] els_pan - bugfix gravity move Date: Mon, 5 Dec 2011 13:29:48 +0900 Dear developers. When gravity set on els_pan, user events are processing improperly. Any touch event move pan to wrong position. It's due to accumulate px, py. So I fixed it. Thanks git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/elementary@65885 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- src/lib/els_pan.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/lib/els_pan.c b/src/lib/els_pan.c index ff3cc5c..4e02b3d 100644 --- a/src/lib/els_pan.c +++ b/src/lib/els_pan.c @@ -195,16 +195,19 @@ _smart_reconfigure(Smart_Data *sd) { if (sd->gravity_x || sd->gravity_y) { + if ((!sd->px) && (!sd->py)) + { + sd->px = sd->delta_posx*sd->gravity_x; + sd->py = sd->delta_posy*sd->gravity_y; + } sd->delta_posx += sd->child_w - sd->prev_cw; sd->prev_cw = sd->child_w; sd->delta_posy += sd->child_h - sd->prev_ch; sd->prev_ch = sd->child_h; - evas_object_move(sd->child_obj, - sd->x - sd->px - (sd->delta_posx*sd->gravity_x), - sd->y - sd->py - (sd->delta_posy*sd->gravity_y)); - sd->px += sd->delta_posx*sd->gravity_x; - sd->py += sd->delta_posy*sd->gravity_y; + evas_object_move(sd->child_obj, sd->x - sd->px, sd->y - sd->py); + sd->px = sd->delta_posx*sd->gravity_x; + sd->py = sd->delta_posy*sd->gravity_y; } else -- 2.7.4