File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,9 @@ local dynamic_lists = {}
9
9
10
10
-- update the positions of the list items and set their data indices
11
11
local function update_dynamic_listitem_positions (list )
12
+ if list .data_size == 0 then
13
+ return
14
+ end
12
15
local top_i , top_y , top_x
13
16
if list .horizontal then
14
17
top_i = list .scroll_pos .x / list .item_size .x
@@ -22,7 +25,7 @@ local function update_dynamic_listitem_positions(list)
22
25
local item = list .items [i ]
23
26
local item_pos = gui .get_position (item .root )
24
27
local index = first_index + i - 1
25
- item .index = ((index - 1 ) % # list .data ) + 1
28
+ item .index = ((index - 1 ) % list .data_size ) + 1
26
29
if list .horizontal then
27
30
item_pos .x = list .first_item_pos .x - (list .item_size .x * (i - 1 )) + top_x
28
31
else
You can’t perform that action at this time.
0 commit comments