Roller with more than 27 items goes weird

Description

When I add more than 27 items to a roller it starts showing the wrong items as selected. For example it shows 00 then 37 then 03

This seems to happen only when the scroll mode is infinite.

What MCU/Processor/Board and compiler are you using?

Simulator

What LVGL version are you using?

8.1

What do you want to achieve?

Id like to have a roller that has an item for each minute of the hour (60 items)

What have you tried so far?

Reducing the number of items and incrementing it until it breaks.

Also setting the following made no difference:
#define LV_USE_LARGE_COORD 1

Code to reproduce

    lv_obj_t * minute = lv_roller_create(cont);
    lv_roller_set_options(minute, 
                              "00\n01\n02\n03\n04\n05\n06\n07\n08\n09\n"
                              "10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n"
                              "20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n"
                              "30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n"
                              "40\n41\n42\n43\n44\n45\n46\n47\n48\n49\n"
                              "50\n51\n52\n53\n54\n55\n56\n57\n58\n59"
                              ,
                              LV_ROLLER_MODE_INFINITE
                              );
    lv_obj_align_to(minute, calendar, LV_ALIGN_BOTTOM_RIGHT, 0, 160);
    lv_obj_add_event_cb(minute, cb_calendar_leavingTimeMM, LV_EVENT_ALL, userData);

Screenshot and/or video

Thanks!

Hello,
I don’t what cause this problem but it can be solved by lowering the number of infinite pages by changing the following line in lv_conf.h. ( I tried 3 and it works ).

#if LV_USE_ROLLER
#  define LV_ROLLER_INF_PAGES 3 /*Number of extra "pages" when the roller is infinite*/
#endif
1 Like

Oh, wow. I did try upping it to 10 (and that obviously didnt work). I didnt even think of reducing it…

Does anyone know what this extra “pages” things does?

But yes, thanks, that did fix it for me :slight_smile:

Thanks!