summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwonguk.jeong <wonguk.jeong@samsung.com>2014-04-21 15:06:28 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2014-04-21 15:06:28 +0900
commit9d2b5afc4a4e4afba7fb42744e98df8b91aef7c0 (patch)
tree48eaf4d766e6ba6770a67451d0f1223bdc84b49c
parentfbd30582d45717525e13ed961a46f97c28166b68 (diff)
downloadelementary-9d2b5afc4a4e4afba7fb42744e98df8b91aef7c0.tar.gz
elm_interface_scrollable: fix wanted coordinate calculation
Summary: boundary check of _elm_scroll_wanted_coordinates_update() is wrong. boundary was checked with assumption that 0, 0 is top, left however, 0, 0 could be different according to usages, in case of gengrid, 0, 0 was center left not top left) Do not assume the min/max value, but use pan min/max value for boundary check Fixes T1092 Test Plan: elementary_test -> grid -> uncheck multi select mode -> select first item -> click bring in -> resize window Reviewers: raster, woohyun, seoz, zmike CC: seoz Maniphest Tasks: T1092 Differential Revision: https://phab.enlightenment.org/D720
-rw-r--r--src/lib/elm_interface_scrollable.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/src/lib/elm_interface_scrollable.c b/src/lib/elm_interface_scrollable.c
index 61610e217..d62002322 100644
--- a/src/lib/elm_interface_scrollable.c
+++ b/src/lib/elm_interface_scrollable.c
@@ -1198,27 +1198,26 @@ _elm_scroll_wanted_coordinates_update(Elm_Scrollable_Smart_Interface_Data *sid,
Evas_Coord x,
Evas_Coord y)
{
- Evas_Coord cw, ch;
+ Evas_Coord mx = 0, my = 0, minx = 0, miny = 0;
if (!sid->pan_obj) return;
- eo_do(sid->pan_obj, elm_obj_pan_content_size_get(&cw, &ch));
+ eo_do(sid->pan_obj, elm_obj_pan_pos_max_get(&mx, &my));
+ eo_do(sid->pan_obj, elm_obj_pan_pos_min_get(&minx, &miny));
/* Update wx/y/w/h - and if the requested positions aren't legal
* adjust a bit. */
eo_do(sid->obj, elm_interface_scrollable_content_viewport_geometry_get
(NULL, NULL, &sid->ww, &sid->wh));
- if (x < 0)
- sid->wx = 0;
- else if ((x + sid->ww) > cw)
- sid->wx = cw - sid->ww;
+
+ if (x < minx) sid->wx = minx;
+ else if (x > mx) sid->wx = mx;
else if (sid->is_mirrored)
sid->wx = _elm_scroll_x_mirrored_get(sid->obj, x);
- else
- sid->wx = x;
- if (y < 0) sid->wy = 0;
- else if ((y + sid->wh) > ch)
- sid->wy = ch - sid->wh;
+ else sid->wx = x;
+
+ if (y < miny) sid->wy = miny;
+ else if (y > my) sid->wy = my;
else sid->wy = y;
}