scrollable_interface: fixed logic for calcualting position to scroll.
authorHosang Kim <hosang12.kim@samsung.com>
Mon, 19 Dec 2016 03:50:07 +0000 (12:50 +0900)
committerWonki Kim <wonki_.kim@samsung.com>
Mon, 2 Jan 2017 05:37:09 +0000 (14:37 +0900)
When width of parameter(w) is bigger than or equal to scroller's
width(pw), scrollable object must be scrolled to x position.

Change-Id: I168cd7946cd689db4fca5e170b9e2e2d86e7efc5

src/lib/elm_interface_scrollable.c

index 63da7f6..787a477 100644 (file)
@@ -1723,7 +1723,17 @@ _elm_scroll_content_region_show_internal(Evas_Object *obj,
    evas_object_geometry_get(sid->pan_obj, NULL, NULL, &pw, &ph);
 
    nx = x;
+   if ((x > px) && (w < pw))
+     {
+        if ((px + pw) < (x + w)) nx = x - pw + w;
+        else nx = px;
+     }
    ny = y;
+   if ((y > py) && (h < ph))
+     {
+        if ((py + ph) < (y + h)) ny = y - ph + h;
+        else ny = py;
+     }
 
    if ((sid->down.bounce_x_animator) || (sid->down.bounce_y_animator) ||
        (sid->scrollto.x.animator) || (sid->scrollto.y.animator))