genlist: Fix rare jump in prepend insert
authorJean-Philippe Andre <jp.andre@samsung.com>
Fri, 24 Feb 2017 06:16:45 +0000 (15:16 +0900)
committerJean-Philippe Andre <jp.andre@samsung.com>
Mon, 27 Feb 2017 07:26:32 +0000 (16:26 +0900)
commit380759a89e88f3f3cc0d4038f3dc5bd5c623160f
tree65865d71a3286a3ea8793e35d5ad3608bd5210e7
parentbb38083287b963a63439f87a619ba514d89ded9c
genlist: Fix rare jump in prepend insert

If an item is selected, and another item is insert before
the selected item, then we try to lock the genlist view (pan)
around the selected item (if it's visible). Unfortunately,
every 16 inserts cause a jump by one line in the scroller.
That's because the scroll math assumes the block position is
known, but since it's a new block it wasn't known.

This patch fixes this issue by precalculating the block position.

Test scenario:
 elementary_test -to "Genlist Tree, Insert Relative"

Select an item, clikck 50 times on "+ before".
The view should not jump.

This does not fix fileselector's craziness.

@fix
src/lib/elementary/elm_genlist.c