From e947e27441dbb9a621f8189e23a2bd69d59ca824 Mon Sep 17 00:00:00 2001 From: Hosang Kim Date: Fri, 28 Aug 2015 18:08:14 +0900 Subject: [PATCH] Revert "Elm_Interface_Scrollable: Improvement in looping behavior" 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 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lib/elm_interface_scrollable.c b/src/lib/elm_interface_scrollable.c index 5bc5509..27a46c1 100644 --- a/src/lib/elm_interface_scrollable.c +++ b/src/lib/elm_interface_scrollable.c @@ -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) -- 2.7.4