summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSangHyeon Lee <dltkdgus1764@gmail.com>2015-06-25 16:44:41 +0200
committerCedric BAIL <cedric@osg.samsung.com>2015-06-25 17:24:08 +0200
commite10bb019fa962a564e42a45536d94c2ee23d0fbc (patch)
treee14f38ebfd8d19b8ecdaf41320cd0b34a6acd523
parent2392ee830beccea338c2284ec2a5d2466b808439 (diff)
elm_interface_scrollable: fix wrong mirrored calculation
Summary: This Patch is regarding D2553, but funtionally independent patch. D2557 is also related with this patch, so to test working fine, need to install those all three patches. 1. _elm_interface_scrollable_content_region_show store wx into scroll_interface_data without coverting mirrored_x. fix to store wx to mirror-converted x if is_mirrored. 2. _elm_scroll_x_mirrored_get return mirroed_x after compare zero not minx. so current mirrored_x couldn't be less then 0. fix to check min not 0 for set return value. 3. _elm_scroll_x_mirrored_get calculation need to consider start position of scroller. some scroller(e.g. gengrid) start from non-zero position, so calculation need to change like below. ret = (cw - (x + w - min)); @fix Test Plan: You can test this after merge D2553 patch and D2557 and test gengrid2. Reviewers: raster, Hermet, seoz, jaehwan, tanwar.umesh07, cedric Subscribers: tanwar.umesh07, Jaehyun, anand.km, eagleeye, singh.amitesh Differential Revision: https://phab.enlightenment.org/D2558 Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
-rw-r--r--src/lib/elm_interface_scrollable.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/lib/elm_interface_scrollable.c b/src/lib/elm_interface_scrollable.c
index bf598db07..4adebcd6c 100644
--- a/src/lib/elm_interface_scrollable.c
+++ b/src/lib/elm_interface_scrollable.c
@@ -1197,18 +1197,19 @@ static Evas_Coord
1197_elm_scroll_x_mirrored_get(const Evas_Object *obj, 1197_elm_scroll_x_mirrored_get(const Evas_Object *obj,
1198 Evas_Coord x) 1198 Evas_Coord x)
1199{ 1199{
1200 Evas_Coord cw = 0, ch = 0, w = 0, ret; 1200 Evas_Coord cw = 0, w = 0, min = 0, ret;
1201 1201
1202 ELM_SCROLL_IFACE_DATA_GET_OR_RETURN_VAL(obj, sid, x); 1202 ELM_SCROLL_IFACE_DATA_GET_OR_RETURN_VAL(obj, sid, x);
1203 1203
1204 if (!sid->pan_obj) return 0; 1204 if (!sid->pan_obj) return 0;
1205 1205
1206 eo_do(sid->pan_obj, elm_obj_pan_pos_min_get(&min, NULL));
1206 eo_do((Eo *)obj, elm_interface_scrollable_content_viewport_geometry_get 1207 eo_do((Eo *)obj, elm_interface_scrollable_content_viewport_geometry_get
1207 (NULL, NULL, &w, NULL)); 1208 (NULL, NULL, &w, NULL));
1208 eo_do(sid->pan_obj, elm_obj_pan_content_size_get(&cw, &ch)); 1209 eo_do(sid->pan_obj, elm_obj_pan_content_size_get(&cw, NULL));
1209 ret = (cw - (x + w)); 1210 ret = cw - w - x + min + min;
1210 1211
1211 return (ret >= 0) ? ret : 0; 1212 return (ret >= min) ? ret : min;
1212} 1213}
1213 1214
1214/* Update the wanted coordinates according to the x, y passed 1215/* Update the wanted coordinates according to the x, y passed
@@ -1808,7 +1809,7 @@ _elm_interface_scrollable_content_region_set(Eo *obj, Elm_Scrollable_Smart_Inter
1808EOLIAN static void 1809EOLIAN static void
1809_elm_interface_scrollable_content_region_show(Eo *obj, Elm_Scrollable_Smart_Interface_Data *sid, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h) 1810_elm_interface_scrollable_content_region_show(Eo *obj, Elm_Scrollable_Smart_Interface_Data *sid, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h)
1810{ 1811{
1811 sid->wx = x; 1812 sid->wx = (sid->is_mirrored ? _elm_scroll_x_mirrored_get(sid->obj, x) : x);
1812 sid->wy = y; 1813 sid->wy = y;
1813 sid->ww = w; 1814 sid->ww = w;
1814 sid->wh = h; 1815 sid->wh = h;
@@ -4303,7 +4304,7 @@ _elm_interface_scrollable_page_show(Eo *obj, Elm_Scrollable_Smart_Interface_Data
4303 if (pagenumber_h >= 0) x = sid->pagesize_h * pagenumber_h; 4304 if (pagenumber_h >= 0) x = sid->pagesize_h * pagenumber_h;
4304 if (pagenumber_v >= 0) y = sid->pagesize_v * pagenumber_v; 4305 if (pagenumber_v >= 0) y = sid->pagesize_v * pagenumber_v;
4305 4306
4306 sid->wx = x; 4307 sid->wx = (sid->is_mirrored ? _elm_scroll_x_mirrored_get(sid->obj, x) : x);
4307 sid->wy = y; 4308 sid->wy = y;
4308 sid->ww = w; 4309 sid->ww = w;
4309 sid->wh = h; 4310 sid->wh = h;