genlist: fixing wrong scroll posiiton calc in SCROLLTO_IN 40/108440/3
authorSangHyeon Lee <sh10233.lee@samsung.com>
Mon, 2 Jan 2017 10:20:38 +0000 (19:20 +0900)
committerSangHyeon Lee <sh10233.lee@samsung.com>
Wed, 4 Jan 2017 09:54:53 +0000 (01:54 -0800)
Change-Id: I4da1d63cf0fd81fd6695668941d8f30cf326c350
(cherry picked from commit 22c2730d65c95be9f8fb92fdde1b22dae6d18c69)

src/mobile_lib/elm_genlist.c

index 5b8fa06a25215fada57dda142f2746032eab4521..8a0f6f01a0651a74d35bc55625f825a273a3dc5f 100644 (file)
@@ -2631,23 +2631,20 @@ _elm_genlist_pan_evas_object_smart_calculate(Eo *obj, Elm_Genlist_Pan_Data *psd)
        psd->wsd->show_item->item->block->calc_done &&
        psd->wsd->calc_done)
      {
-        Evas_Coord x, y;
+        Evas_Coord x, y, w, h;
         Elm_Gen_Item *it = psd->wsd->show_item;
         psd->wsd->show_item = NULL;
         x = it->x + GL_IT(it)->block->x;
         y = it->y + GL_IT(it)->block->y;
+        w = ow;
+        h = oh;
 
         switch (psd->wsd->scroll_to_type)
           {
            case ELM_GENLIST_ITEM_SCROLLTO_IN:
-              if ((y >= psd->wsd->pan_y) &&
-                  ((y + GL_IT(it)->minh) <= (psd->wsd->pan_y + oh)))
-                {
-                   y = psd->wsd->pan_y;
-                }
-              else if (psd->wsd->pan_y <= y)
-                 y -= (oh - GL_IT(it)->minh);
+              h = GL_IT(it)->h;
               break;
+
            case ELM_GENLIST_ITEM_SCROLLTO_MIDDLE:
               y = y - (oh / 2) + (GL_IT(it)->h / 2);
               break;
@@ -2660,7 +2657,7 @@ _elm_genlist_pan_evas_object_smart_calculate(Eo *obj, Elm_Genlist_Pan_Data *psd)
               break;
           }
         if (psd->wsd->bring_in)
-          eo_do(WIDGET(it), elm_interface_scrollable_region_bring_in(x, y, ow, oh));
+          eo_do(WIDGET(it), elm_interface_scrollable_region_bring_in(x, y, w, h));
         else
           {
              if (psd->wsd->aligned_item && (psd->wsd->aligned_item != psd->wsd->adjusted_item))