mirror of
https://github.com/lvgl/lvgl.git
synced 2025-01-28 07:03:00 +08:00
fix(chart) be sure the chart doesn't remain scrolled out on zoom out
fixes https://forum.lvgl.io/t/some-questions-about-chart-line-data-refresh/6383/4?u=kisvegabor
This commit is contained in:
parent
98bc1fe09e
commit
ad5b1bdc00
@ -188,6 +188,8 @@ void lv_chart_set_zoom_x(lv_obj_t * obj, uint16_t zoom_x)
|
|||||||
|
|
||||||
chart->zoom_x = zoom_x;
|
chart->zoom_x = zoom_x;
|
||||||
lv_obj_refresh_self_size(obj);
|
lv_obj_refresh_self_size(obj);
|
||||||
|
/*Be the chart doesn't remain scrolled out*/
|
||||||
|
lv_obj_readjust_scroll(obj, LV_ANIM_OFF);
|
||||||
lv_obj_invalidate(obj);
|
lv_obj_invalidate(obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -200,6 +202,8 @@ void lv_chart_set_zoom_y(lv_obj_t * obj, uint16_t zoom_y)
|
|||||||
|
|
||||||
chart->zoom_y = zoom_y;
|
chart->zoom_y = zoom_y;
|
||||||
lv_obj_refresh_self_size(obj);
|
lv_obj_refresh_self_size(obj);
|
||||||
|
/*Be the chart doesn't remain scrolled out*/
|
||||||
|
lv_obj_readjust_scroll(obj, LV_ANIM_OFF);
|
||||||
lv_obj_invalidate(obj);
|
lv_obj_invalidate(obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user