diff --git a/src/core/lv_refr.c b/src/core/lv_refr.c index 9ed1845c4d..e136d67b8e 100644 --- a/src/core/lv_refr.c +++ b/src/core/lv_refr.c @@ -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); 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(com_clip_res) { + /*If the object is visible on the current clip area OR has overflow visible draw it. + *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 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); #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 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(com_clip_res) { + if(should_draw) { draw_ctx->clip_area = &clip_coords_for_obj; /*If all the children are redrawn make 'post draw' draw*/