gengrid: fix item append wanted region adjust in mirrored screen submit/tizen/20200219.213751
authorSangHyeon Jade Lee <sh10233.lee@samsung.com>
Wed, 19 Feb 2020 10:57:28 +0000 (19:57 +0900)
committerJongmin Lee <jm105.lee@samsung.com>
Wed, 19 Feb 2020 21:07:04 +0000 (06:07 +0900)
Change-Id: If71bed64a95ef3b7bdc5b4a411b7e735702ee89b
Signed-off-by: SangHyeon Jade Lee <sh10233.lee@samsung.com>
src/lib/elementary/elm_gengrid.c

index 029b7bb..8b4721f 100755 (executable)
@@ -5797,7 +5797,8 @@ _elm_gengrid_item_append(Eo *obj, Elm_Gengrid_Data *sd, const Elm_Gengrid_Item_C
 {
    Elm_Gen_Item *it;
    //TIZEN_ONLY(20150825) : Use the specific wanted_region_set func only for gengrid.
-   int pos_x, pos_y, min_x, min_y;
+   int pos_x, pos_y, min_x, min_y, mx;
+   Eina_Bool mirrored;
    //
 
    it = _elm_gengrid_item_new(sd, itc, data, func, func_data);
@@ -5820,7 +5821,9 @@ _elm_gengrid_item_append(Eo *obj, Elm_Gengrid_Data *sd, const Elm_Gengrid_Item_C
    sd->is_append = EINA_TRUE;
    elm_obj_pan_pos_get(sd->pan_obj, &pos_x, &pos_y);
    elm_obj_pan_pos_min_get(sd->pan_obj, &min_x, &min_y);
-   sd->top_to_x = pos_x - min_x;
+   elm_obj_pan_pos_max_get(sd->pan_obj, &mx, NULL);
+   mirrored = efl_ui_mirrored_get(obj);
+   sd->top_to_x = (mirrored ? (mx + min_x - pos_x) : (pos_x - min_x));
    sd->top_to_y = pos_y - min_y;
    //
    return EO_OBJ(it);
@@ -5886,7 +5889,8 @@ _elm_gengrid_item_insert_after(Eo *obj, Elm_Gengrid_Data *sd, const Elm_Gengrid_
 {
    Elm_Gen_Item *it;
    //TIZEN_ONLY(20150825) : Use the specific wanted_region_set func only for gengrid.
-   int pos_x, pos_y, min_x, min_y;
+   int pos_x, pos_y, min_x, min_y, mx;
+   Eina_Bool mirrored;
    //
    Eina_Inlist *tmp;
    EINA_SAFETY_ON_NULL_RETURN_VAL(eo_relative, NULL);
@@ -5917,7 +5921,9 @@ _elm_gengrid_item_insert_after(Eo *obj, Elm_Gengrid_Data *sd, const Elm_Gengrid_
    sd->is_append = EINA_TRUE;
    elm_obj_pan_pos_get(sd->pan_obj, &pos_x, &pos_y);
    elm_obj_pan_pos_min_get(sd->pan_obj, &min_x, &min_y);
-   sd->top_to_x = pos_x - min_x;
+   elm_obj_pan_pos_max_get(sd->pan_obj, &mx, NULL);
+   mirrored = efl_ui_mirrored_get(obj);
+   sd->top_to_x = (mirrored ? (mx + min_x - pos_x) : (pos_x - min_x));
    sd->top_to_y = pos_y - min_y;
    //
 
@@ -6952,15 +6958,17 @@ _elm_gengrid_elm_interface_scrollable_wanted_region_set(Eo *obj EINA_UNUSED, Elm
    if (sd->is_append)
      {
         Evas_Coord pan_x, pan_y;
-        Evas_Coord minx, miny;
+        Evas_Coord minx, miny, mx;
         Evas_Coord set_x, set_y;
+        Eina_Bool mirrored = efl_ui_mirrored_get(obj);
 
         elm_obj_pan_pos_get(sd->pan_obj, &pan_x, &pan_y);
         elm_obj_pan_pos_min_get(sd->pan_obj, &minx, &miny);
+        elm_obj_pan_pos_max_get(sd->pan_obj, &mx, NULL);
 
         if (sd->horizontal)
           {
-             set_x = minx + sd->top_to_x;
+             set_x = (mirrored ? (mx + minx - sd->top_to_x) : (minx + sd->top_to_x));
              elm_interface_scrollable_content_pos_set(sd->obj, set_x, pan_y, EINA_TRUE);
           }
         else