genlist: scroll to item when calc is done 64/66464/1
authorJee-Yong Um <jc9.um@samsung.com>
Tue, 19 Apr 2016 05:03:47 +0000 (14:03 +0900)
committerJee-Yong Um <jc9.um@samsung.com>
Tue, 19 Apr 2016 05:11:28 +0000 (14:11 +0900)
========================================================================
   genlist: scroll to item when calc is done

   Summary:
   If elm_genlist_item_bring_in() is called immediately after appending
   item, genlist will not scroll to the last one but stop in the middle.
   This patch blocks genlist from scrolling to not calculated item.

   Reviewers: cedric, SanghyeonLee

   Reviewed By: SanghyeonLee

   Subscribers: jpeg

   Differential Revision: https://phab.enlightenment.org/D3861
========================================================================

Change-Id: I4e9af177bce95fabe687bb41b470743a4b8abb1d
Signed-Off-By: Jee-Yong Um <jc9.um@samsung.com>
src/lib/elm_genlist.c

index 8b7cf6a..e18d737 100644 (file)
@@ -271,6 +271,9 @@ _item_scroll(Elm_Genlist_Smart_Data *sd)
    dw = it->item->block->w;
    dh = oh;
 
+   // hold on scrolling to item until block size calculation is finished.
+   if (dw < 1) return;
+
    switch (sd->scroll_to_type)
      {
       case ELM_GENLIST_ITEM_SCROLLTO_TOP: