hermet pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=b1650ca4716ac351e21a6d6b62cbf3489c816a09

commit b1650ca4716ac351e21a6d6b62cbf3489c816a09
Author: SangHyeon Jade Lee <[email protected]>
Date:   Wed Sep 19 09:36:51 2018 +0900

    genlist: fix item show/bring in coordinate calculation with zero-sized pan.
    
    Summary:
    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.
    
    Test Plan:
    please test with attached file.
    ./main 8 4 : 8th item go to middle
    ./main 8 8 : 8th item go to bottom
    
    (bottom case may need D7035 as precede patch)
    
    {F3311262}
    
    Reviewers: Hermet, eagleeye
    
    Subscribers: cedric, #reviewers, #committers
    
    Tags: #efl
    
    Differential Revision: https://phab.enlightenment.org/D7037
---
 src/lib/elementary/elm_genlist.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/lib/elementary/elm_genlist.c b/src/lib/elementary/elm_genlist.c
index c6469d7456..2dac08d1b8 100644
--- a/src/lib/elementary/elm_genlist.c
+++ b/src/lib/elementary/elm_genlist.c
@@ -639,6 +639,7 @@ _item_scroll(Elm_Genlist_Data *sd)
    dh = oh;
 
    if (dw < 1) return;
+   if (ow < 1 || oh < 1) return;
 
    switch (sd->scroll_to_type)
      {
@@ -7191,7 +7192,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)
      {
@@ -7213,7 +7217,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:

-- 


Reply via email to