mirror of
https://github.com/lvgl/lvgl.git
synced 2024-11-23 01:33:59 +08:00
fix(roller): fix typo in scaling; prevent division by zero (#7263)
This commit is contained in:
parent
590299a820
commit
547c2ef226
@ -880,12 +880,20 @@ static void transform_vect_recursive(lv_obj_t * roller, lv_point_t * vect)
|
||||
angle += lv_obj_get_style_transform_rotation(parent, 0);
|
||||
int32_t zoom_act_x = lv_obj_get_style_transform_scale_x_safe(parent, 0);
|
||||
int32_t zoom_act_y = lv_obj_get_style_transform_scale_y_safe(parent, 0);
|
||||
scale_x = (scale_y * zoom_act_x) >> 8;
|
||||
scale_x = (scale_x * zoom_act_x) >> 8;
|
||||
scale_y = (scale_y * zoom_act_y) >> 8;
|
||||
parent = lv_obj_get_parent(parent);
|
||||
}
|
||||
lv_point_t pivot = { 0, 0 };
|
||||
|
||||
if(scale_x == 0) {
|
||||
scale_x = 1;
|
||||
}
|
||||
|
||||
if(scale_y == 0) {
|
||||
scale_y = 1;
|
||||
}
|
||||
|
||||
scale_x = 256 * 256 / scale_x;
|
||||
scale_y = 256 * 256 / scale_y;
|
||||
lv_point_transform(vect, -angle, scale_x, scale_y, &pivot, false);
|
||||
|
Loading…
Reference in New Issue
Block a user