Revert "Elm_Interface_Scrollable: Improvement in looping behavior"
authorHosang Kim <hosang12.kim@samsung.com>
Fri, 28 Aug 2015 09:08:14 +0000 (18:08 +0900)
committerChunEon Park <hermet@hermet.pe.kr>
Fri, 28 Aug 2015 09:08:15 +0000 (18:08 +0900)
Summary:
This reverts commit bba4c217f2ce4f032fca6298cc8b2fc6ff3d7c19.

"x and y position variable assumes values ranging from min to max " is right.
but in looping behavior, x and y are able to have value bigger than max or smaller than min.

@fix

Test Plan:
1. elementary_test -> scroller
           2. on Loop in X axis
           3. scrolling page to left.
           4. page is moved last page directly.

Reviewers: SanghyeonLee, tanwar.umesh07, raster, cedric, jaehwan, Hermet

Reviewed By: Hermet

Differential Revision: https://phab.enlightenment.org/D2977

src/lib/elm_interface_scrollable.c

index 5bc5509..27a46c1 100644 (file)
@@ -1515,13 +1515,13 @@ _elm_interface_scrollable_content_pos_set(Eo *obj, Elm_Scrollable_Smart_Interfac
 
    if (sid->loop_h && cw > 0)
      {
-        if (x < minx) x = mx + (x % mx);
-        else if (x > mx) x = (x % mx);
+        if (x < 0) x = cw + (x % cw);
+        else if (x >= cw) x = (x % cw);
      }
    if (sid->loop_v && ch > 0)
      {
-        if (y < miny) y = my + (y % my);
-        else if (y > my) y = (y % my);
+        if (y < 0) y = ch + (y % ch);
+        else if (y >= ch) y = (y % ch);
      }
 
    if (!_elm_config->thumbscroll_bounce_enable)