scroller: Limit coordination when there is only one page 31/100231/6
authorWonki Kim <wonki_.kim@samsung.com>
Fri, 25 Nov 2016 10:23:46 +0000 (19:23 +0900)
committerGerrit Code Review <gerrit@review.vlan103.tizen.org>
Thu, 8 Dec 2016 07:14:03 +0000 (23:14 -0800)
By applying scroll improvement code, coordination should be limited
with in the page when scroller has just one page

@tizen_fix

Change-Id: I8bc092a73c3a2c68bec5cf59764e1a5bd08b7a06
Signed-off-by: Wonki Kim <wonki_.kim@samsung.com>
src/lib/elm_interface_scrollable.c

index 4a34d8c..68f4a6d 100644 (file)
@@ -3067,6 +3067,28 @@ _elm_scroll_post_event_move(void *data,
    return EINA_TRUE;
 }
 
+
+// TIZEN_ONLY(20161125): Limit coordination when there is just one page
+static void
+_elm_scroll_down_coord_limit(Elm_Scrollable_Smart_Interface_Data *sid,
+                             Evas_Coord *x,
+                             Evas_Coord *y)
+{
+   Evas_Coord w = 0, h = 0;
+
+   evas_object_geometry_get(sid->pan_obj, NULL, NULL, &w, &h);
+
+   if (sid->loop_h &&
+       ((*x + sid->content_info.w) % sid->content_info.w - w < 0) &&
+       ((*x + sid->content_info.w) % sid->content_info.w + w > sid->content_info.w))
+     *x = 0;
+   if (sid->loop_v &&
+       ((*y + sid->content_info.h) % sid->content_info.h - h < 0) &&
+       ((*y + sid->content_info.h) % sid->content_info.h + h > sid->content_info.h))
+     *y = 0;
+}
+// END
+
 static void
 _elm_scroll_down_coord_eval(Elm_Scrollable_Smart_Interface_Data *sid,
                             Evas_Coord *x,
@@ -3107,9 +3129,11 @@ _elm_scroll_down_coord_eval(Elm_Scrollable_Smart_Interface_Data *sid,
    else if (!sid->loop_v && (sid->content_info.h - sid->h + miny) < *y)
      *y += (sid->content_info.h - sid->h + miny - *y) *
        _elm_config->thumbscroll_border_friction;
-}
-
 
+   // TIZEN_ONLY(20161125): Limit coordination when there is just one page
+   _elm_scroll_down_coord_limit(sid, x, y);
+   // END
+}
 
 //TIZEN ONLY : for scroll smooth algorithm
 #define iround(x) ((x)>=0?(int)((x)+0.5):(int)((x)-0.5))