elm_interface_scrollable: fix calculating position logic. 78/104978/2
authorHosang Kim <hosang12.kim@samsung.com>
Thu, 15 Dec 2016 04:58:40 +0000 (13:58 +0900)
committerGerrit Code Review <gerrit@review.vlan103.tizen.org>
Thu, 15 Dec 2016 05:38:52 +0000 (21:38 -0800)
The target position should be calculated without width and
height.

Change-Id: I88b450e9e70009efc288c2b5e94957513cd08b53

src/lib/elm_interface_scrollable.c

index 3f89bc6..63da7f6 100644 (file)
@@ -1710,27 +1710,20 @@ _elm_scroll_content_region_show_internal(Evas_Object *obj,
                                          Evas_Coord w,
                                          Evas_Coord h)
 {
-   Evas_Coord mx = 0, my = 0, cw = 0, ch = 0, px = 0, py = 0, nx, ny,
+   Evas_Coord cw = 0, ch = 0, px = 0, py = 0, nx, ny,
               minx = 0, miny = 0, pw = 0, ph = 0, x = *_x, y = *_y;
 
    ELM_SCROLL_IFACE_DATA_GET_OR_RETURN_VAL(obj, sid, EINA_FALSE);
 
    if (!sid->pan_obj) return EINA_FALSE;
 
-   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));
    eo_do(sid->pan_obj, elm_obj_pan_content_size_get(&cw, &ch));
    eo_do(sid->pan_obj, elm_obj_pan_pos_get(&px, &py));
    evas_object_geometry_get(sid->pan_obj, NULL, NULL, &pw, &ph);
 
-   nx = px;
-   if ((x < px) && ((x + w) < (px + (cw - mx)))) nx = x;
-   else if ((x > px) && ((x + w) > (px + (cw - mx))))
-     nx = x + w - (cw - mx);
-   ny = py;
-   if ((y < py) && ((y + h) < (py + (ch - my)))) ny = y;
-   else if ((y > py) && ((y + h) > (py + (ch - my))))
-     ny = y + h - (ch - my);
+   nx = x;
+   ny = y;
 
    if ((sid->down.bounce_x_animator) || (sid->down.bounce_y_animator) ||
        (sid->scrollto.x.animator) || (sid->scrollto.y.animator))