fix(refr): consider masks with LV_OBJ_FLAG_OVERFLOW_VISIBLE

fixes: #3151
This commit is contained in:
Gabor Kiss-Vamosi
2022-04-04 18:37:20 +02:00
parent 57e3697dca
commit a7f9dfa8c3
+5 -8
View File
@@ -139,8 +139,10 @@ void lv_refr_obj(lv_draw_ctx_t * draw_ctx, lv_obj_t * obj)
lv_area_increase(&obj_coords_ext, ext_draw_size, ext_draw_size); lv_area_increase(&obj_coords_ext, ext_draw_size, ext_draw_size);
bool com_clip_res = _lv_area_intersect(&clip_coords_for_obj, clip_area_ori, &obj_coords_ext); bool com_clip_res = _lv_area_intersect(&clip_coords_for_obj, clip_area_ori, &obj_coords_ext);
/*If the object is visible on the current clip area draw it.*/ /*If the object is visible on the current clip area OR has overflow visible draw it.
if(com_clip_res) { *With overflow visible drawing should happen to apply the masks which might affect children */
bool should_draw = com_clip_res || lv_obj_has_flag(obj, LV_OBJ_FLAG_OVERFLOW_VISIBLE);
if(should_draw) {
draw_ctx->clip_area = &clip_coords_for_obj; draw_ctx->clip_area = &clip_coords_for_obj;
/*Draw the object*/ /*Draw the object*/
@@ -160,11 +162,6 @@ void lv_refr_obj(lv_draw_ctx_t * draw_ctx, lv_obj_t * obj)
lv_draw_rect(draw_ctx, &draw_dsc, &obj_coords_ext); lv_draw_rect(draw_ctx, &draw_dsc, &obj_coords_ext);
#endif #endif
} }
/*If not visible on the current clip area and children are clipped to the parent's size
*the object has nothing to do with this area so stop drawing.*/
else if(!lv_obj_has_flag(obj, LV_OBJ_FLAG_OVERFLOW_VISIBLE)) {
return;
}
/*With overflow visible keep the previous clip area to let the children visible out of this object too /*With overflow visible keep the previous clip area to let the children visible out of this object too
*With not overflow visible limit the clip are to the object's coordinates to clip the children*/ *With not overflow visible limit the clip are to the object's coordinates to clip the children*/
@@ -190,7 +187,7 @@ void lv_refr_obj(lv_draw_ctx_t * draw_ctx, lv_obj_t * obj)
} }
/*If the object was visible on the clip area call the post draw events too*/ /*If the object was visible on the clip area call the post draw events too*/
if(com_clip_res) { if(should_draw) {
draw_ctx->clip_area = &clip_coords_for_obj; draw_ctx->clip_area = &clip_coords_for_obj;
/*If all the children are redrawn make 'post draw' draw*/ /*If all the children are redrawn make 'post draw' draw*/