mirror of
https://github.com/lvgl/lvgl.git
synced 2025-01-28 07:03:00 +08:00
fix(invalidation): do not invalidate an area if it's not on a visible screen
This commit is contained in:
parent
e088388fd5
commit
4c56747142
@ -490,10 +490,13 @@ bool lv_obj_area_is_visible(const lv_obj_t * obj, lv_area_t * area)
|
||||
/*Invalidate the object only if it belongs to the current or previous'*/
|
||||
lv_obj_t * obj_scr = lv_obj_get_screen(obj);
|
||||
lv_disp_t * disp = lv_obj_get_disp(obj_scr);
|
||||
if(obj_scr == lv_disp_get_scr_act(disp) ||
|
||||
obj_scr == lv_disp_get_scr_prev(disp) ||
|
||||
obj_scr == lv_disp_get_layer_top(disp) ||
|
||||
obj_scr == lv_disp_get_layer_sys(disp)) {
|
||||
if(obj_scr != lv_disp_get_scr_act(disp) &&
|
||||
obj_scr != lv_disp_get_scr_prev(disp) &&
|
||||
obj_scr != lv_disp_get_layer_top(disp) &&
|
||||
obj_scr != lv_disp_get_layer_sys(disp))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/*Truncate the area to the object*/
|
||||
lv_area_t obj_coords;
|
||||
@ -518,7 +521,6 @@ bool lv_obj_area_is_visible(const lv_obj_t * obj, lv_area_t * area)
|
||||
|
||||
par = lv_obj_get_parent(par);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user