interface_scrollable: Unify basis of calculation of page_get logic 54/109554/3
authorWonki Kim <wonki_.kim@samsung.com>
Tue, 10 Jan 2017 08:02:50 +0000 (17:02 +0900)
committerWooHyun Jung <wh0705.jung@samsung.com>
Wed, 11 Jan 2017 05:25:13 +0000 (21:25 -0800)
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 44713c7f8bcaa49db45d474d9d09ad336948cb16..f63a011836231b5f3e9397b95c07e6e76e960c81 100644 (file)
@@ -5049,10 +5049,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)
      {
@@ -5082,9 +5085,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