interface_scrollable: Unify basis of calculation of page_get logic 64/124364/1
authorWonki Kim <wonki_.kim@samsung.com>
Tue, 10 Jan 2017 08:02:50 +0000 (17:02 +0900)
committerWonki Kim <wonki_.kim@samsung.com>
Tue, 11 Apr 2017 07:25:14 +0000 (16:25 +0900)
if rtl mode is set, current_page_get api will return page number by
substracting by result of last_page_get api to reverse x axis.

but if content size is not a integer multiple of page size,
(which means there is a partial size of the page)
current_page_get api returns a little bit large value.

this commit reverse x axis before calculation logic to unify a kind of
basis of axis.

@tizen_fix

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

index da1e74f..0c9f40b 100644 (file)
@@ -4836,10 +4836,13 @@ EOLIAN static void
 _elm_interface_scrollable_current_page_get(Eo *obj EINA_UNUSED, Elm_Scrollable_Smart_Interface_Data *sid, int *pagenumber_h, int *pagenumber_v)
 {
    Evas_Coord x, y;
-   Evas_Coord last_x;
 
    eo_do(sid->obj, elm_interface_scrollable_content_pos_get(&x, &y));
-   eo_do(sid->obj, elm_interface_scrollable_last_page_get(&last_x, 0));
+
+   // TIZEN_ONLY(20170110): Unify basis of calculation of current_page_get logic on both rtl & ltr
+   if (sid->is_mirrored)
+     x = _elm_scroll_x_mirrored_get(sid->obj, x);
+   // END
 
    if (pagenumber_h)
      {
@@ -4869,9 +4872,6 @@ _elm_interface_scrollable_current_page_get(Eo *obj EINA_UNUSED, Elm_Scrollable_S
         else
           *pagenumber_v = 0;
      }
-
-   if (sid->is_mirrored && pagenumber_h)
-     *pagenumber_h = last_x - *pagenumber_h;
 }
 
 EOLIAN static void