genlist: fix item show/bring in coordinate calculation with zero-sized pan. 06/189406/3
authorSangHyeon Jade Lee <sh10233.lee@samsung.com>
Mon, 17 Sep 2018 10:54:41 +0000 (19:54 +0900)
committerGerrit Code Review <gerrit@review.ap-northeast-2.compute.internal>
Tue, 18 Sep 2018 10:53:53 +0000 (10:53 +0000)
item show and bring can be processed with zero-sized pan.
item's coordinate will be calculated with this zero-sized pan,
so target position of scroll region bring in is not proper.

it occurs wrong result of SCROLLTO_MIDDLE and SCROLLTO_BOTTOM cases.

now we check pan size, and if less than 1, deferred call.

this is port of upstream patch D7037

Change-Id: Ie5d5ecd039d835caefa47c272547506946e91a37
Signed-off-by: SangHyeon Jade Lee <sh10233.lee@samsung.com>
src/lib/elementary/elm_genlist.c

index 9134a37..6cff424 100644 (file)
@@ -698,6 +698,7 @@ _item_scroll(Elm_Genlist_Data *sd)
    dh = oh;
 
    if (dw < 1) return;
+   if (ow < 1 || oh < 1) return;
 
    switch (sd->scroll_to_type)
      {
@@ -7616,7 +7617,10 @@ _elm_genlist_item_coordinates_calc(Elm_Gen_Item *it,
         if ((it->item->queued) || (!it->item->mincalcd) || (sd->queue))
           deferred_show = EINA_TRUE;
      }
-   else if (it->item->block->w < 1) deferred_show = EINA_TRUE;
+   if (it->item->block->w < 1) deferred_show = EINA_TRUE;
+
+   evas_object_geometry_get(sd->pan_obj, NULL, NULL, w, h);
+   if (*w < 1 || *h < 1) deferred_show = EINA_TRUE;
 
    if (deferred_show)
      {
@@ -7638,7 +7642,6 @@ _elm_genlist_item_coordinates_calc(Elm_Gen_Item *it,
         sd->show_item = NULL;
      }
 
-   evas_object_geometry_get(sd->pan_obj, NULL, NULL, w, h);
    switch (type)
      {
       case ELM_GENLIST_ITEM_SCROLLTO_IN: