genlist: scroll to item when calc is done
authorJee-Yong Um <jc9.um@samsung.com>
Tue, 19 Apr 2016 04:59:59 +0000 (13:59 +0900)
committerSangHyeon Lee <sh10233.lee@samsung.com>
Tue, 19 Apr 2016 05:00:42 +0000 (14:00 +0900)
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.

Test Plan:
1. Uncompress attached file
2. make
3. ./test

Reviewers: cedric, SanghyeonLee

Reviewed By: SanghyeonLee

Subscribers: jpeg

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

src/lib/elementary/elm_genlist.c

index f204537..1e8ec97 100644 (file)
@@ -582,6 +582,9 @@ _item_scroll(Elm_Genlist_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: