1
0
mirror of https://github.com/lvgl/lvgl.git synced 2025-01-28 07:03:00 +08:00

fix(roller): fix warning with MSVC

fixes #4601
This commit is contained in:
Gabor Kiss-Vamosi 2023-09-27 09:14:48 +02:00
parent d57000349c
commit 4a95d1467f

View File

@ -181,7 +181,7 @@ void lv_roller_set_selected(lv_obj_t * obj, uint32_t sel_opt, lv_anim_enable_t a
uint32_t act_opt = roller->sel_opt_id - current_page * real_option_cnt;
int32_t sel_opt_signed = sel_opt;
/*Huge jump? Probably from last to first or first to last option.*/
if((uint32_t)LV_ABS((int16_t)act_opt - sel_opt) > real_option_cnt / 2) {
if((uint32_t)LV_ABS((int16_t)(act_opt - sel_opt)) > real_option_cnt / 2) {
if(act_opt > sel_opt) sel_opt_signed += real_option_cnt;
else sel_opt_signed -= real_option_cnt;
}