From 8a81ba120223ac7f14e445ba9e1c4dc072cd647d Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Tue, 25 Jan 2011 02:19:06 +0000 Subject: [PATCH] Elementary: Improved els_scroller's handling with scrolling and 'wanted location', unfortunately momentum scrolling isn't handled correctly at the moment should be fixed. SVN revision: 56294 --- legacy/elementary/src/lib/els_scroller.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/legacy/elementary/src/lib/els_scroller.c b/legacy/elementary/src/lib/els_scroller.c index 7050c8d587..85d002efd4 100644 --- a/legacy/elementary/src/lib/els_scroller.c +++ b/legacy/elementary/src/lib/els_scroller.c @@ -1470,6 +1470,7 @@ _smart_event_wheel(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, { sd->wx = x; sd->wy = y; + elm_smart_scroller_child_viewport_size_get(sd->smart_obj, &sd->ww, &sd->wh); elm_smart_scroller_child_pos_set(sd->smart_obj, x, y); } } @@ -1584,8 +1585,6 @@ _smart_hold_animator(void *data) } } elm_smart_scroller_child_pos_set(sd->smart_obj, ox, oy); - sd->wx = ox; - sd->wy = oy; return ECORE_CALLBACK_RENEW; } @@ -1806,6 +1805,7 @@ _smart_event_mouse_up(void *data, Evas *e, Evas_Object *obj __UNUSED__, void *ev elm_smart_scroller_child_pos_set(sd->smart_obj, x, y); sd->wx = x; sd->wy = y; + elm_smart_scroller_child_viewport_size_get(sd->smart_obj, &sd->ww, &sd->wh); if (!_smart_do_page(sd)) bounce_eval(sd); } @@ -1854,9 +1854,6 @@ _smart_onhold_animator(void *data) } elm_smart_scroller_child_pos_set(sd->smart_obj, x, y); - sd->wx = x; - sd->wy = y; -// printf("scroll %i %i\n", sd->down.hold_x, sd->down.hold_y); } sd->down.onhold_tlast = t; return ECORE_CALLBACK_RENEW; @@ -1945,8 +1942,6 @@ _smart_event_mouse_move(void *data, Evas *e, Evas_Object *obj __UNUSED__, void * #ifdef SCROLLDBG printf("::: %i %i\n", ev->cur.canvas.x, ev->cur.canvas.y); #endif - sd->wx = ev->cur.canvas.x; - sd->wy = ev->cur.canvas.y; memmove(&(sd->down.history[1]), &(sd->down.history[0]), sizeof(sd->down.history[0]) * 19); #ifdef EVTIME @@ -2081,7 +2076,7 @@ _smart_event_mouse_move(void *data, Evas *e, Evas_Object *obj __UNUSED__, void * sd->down.hold_y = y; if (!sd->down.hold_animator) sd->down.hold_animator = - ecore_animator_add(_smart_hold_animator, sd); + ecore_animator_add(_smart_hold_animator, sd); // printf("a %i %i\n", sd->down.hold_x, sd->down.hold_y); // _smart_onhold_animator(sd); // elm_smart_scroller_child_pos_set(sd->smart_obj, x, y);