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

fix(indev): fix integer overflow in recursive zoom calculation

This commit is contained in:
Gabor Kiss-Vamosi 2023-04-24 20:10:33 +02:00
parent a150b15e45
commit a0795b49e8

View File

@ -281,12 +281,13 @@ static lv_obj_t * find_scroll_obj(_lv_indev_proc_t * proc)
while(obj_act) {
/*Get the transformed scroll_sum with this object*/
int16_t angle = 0;
int16_t zoom = 256;
int32_t zoom = 256;
lv_point_t pivot = { 0, 0 };
lv_obj_t * parent = obj_act;
while(parent) {
angle += lv_obj_get_style_transform_angle(parent, 0);
zoom *= (lv_obj_get_style_transform_zoom(parent, 0) / 256);
int32_t zoom_act = lv_obj_get_style_transform_zoom(parent, 0);
zoom = (zoom * zoom_act) >> 8;
parent = lv_obj_get_parent(parent);
}