lvgl / lvgl

Embedded graphics library to create beautiful UIs for any MCU, MPU and display type.
https://lvgl.io
MIT License
16.41k stars 3.22k forks source link

Poor performance of roller widget #7030

Open junminacts opened 1 week ago

junminacts commented 1 week ago

LVGL version

LVGL 9

What happened?

the roller draw performance is poor with many options, especially with LV_ROLLER_MODE_INFINITE modes.

How to reproduce?

No response

kisvegabor commented 1 week ago

Hi,

Please send a code snippet to reproduce the issue. The interesting parts are:

Billername commented 1 week ago

Hi, This is the code snippet. Hope want to calculate only the display area , Thanks.

//opts the longer it is, the less efficient it is. const char opts = "50\n100\n150\n200\n250\n300\n350\n400\n\ 450\n500\n550\n600\n650\n700\n750\n800\n\ 850\n900\n950\n1000\n1050\n1100\n1150\n1200\n\ 1250\n1300\n1350\n1400\n1550\n1600\n1650\n1700\n\ 1750\n1800\n1850\n1900\n1950\n2000\n2050\n2100"; lv_obj_t roller = lv_roller_create(data->tv); lv_roller_set_options(roller,opts,LV_ROLLER_MODE_INFINITE); lv_obj_set_width(roller,80); lv_obj_set_style_text_font(roller,&data->font,LV_PART_SELECTED); lv_obj_set_style_text_font(roller,&data->font,LV_PART_MAIN); lv_obj_set_style_text_color(roller,lv_color_white(),LV_PART_SELECTED); lv_obj_set_style_text_color(roller,lv_color_hex(0x333333),LV_PART_MAIN); lv_obj_set_style_text_align(roller,LV_TEXT_ALIGN_RIGHT,LV_PART_SELECTED); lv_obj_set_style_text_align(roller,LV_TEXT_ALIGN_RIGHT,LV_PART_MAIN); lv_roller_set_visible_row_count(roller,3); lv_obj_align(roller,LV_ALIGN_CENTER,0,0);

kissa96 commented 2 days ago

Hi @Billername Can you please provide a more detailed snippet with the exact fonts and everything, so we can reproduce it 1:1? Thanks in advance!