fix(invalidation): do not invalidate an area if it's not on a visible screen

This commit is contained in:
Gabor Kiss-Vamosi
2021-02-19 12:02:07 +01:00
parent e088388fd5
commit 4c56747142

View File

@@ -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'*/ /*Invalidate the object only if it belongs to the current or previous'*/
lv_obj_t * obj_scr = lv_obj_get_screen(obj); lv_obj_t * obj_scr = lv_obj_get_screen(obj);
lv_disp_t * disp = lv_obj_get_disp(obj_scr); lv_disp_t * disp = lv_obj_get_disp(obj_scr);
if(obj_scr == lv_disp_get_scr_act(disp) || if(obj_scr != lv_disp_get_scr_act(disp) &&
obj_scr == lv_disp_get_scr_prev(disp) || obj_scr != lv_disp_get_scr_prev(disp) &&
obj_scr == lv_disp_get_layer_top(disp) || obj_scr != lv_disp_get_layer_top(disp) &&
obj_scr == lv_disp_get_layer_sys(disp)) { obj_scr != lv_disp_get_layer_sys(disp))
{
return false;
}
/*Truncate the area to the object*/ /*Truncate the area to the object*/
lv_area_t obj_coords; 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); par = lv_obj_get_parent(par);
} }
}
return true; return true;
} }