Fix canvas items being drawn outside clip rects
This commit is contained in:
parent
5f7c1081a7
commit
b0d9e14155
@ -261,6 +261,10 @@ void RendererCanvasCull::_cull_canvas_item(Item *p_canvas_item, const Transform2
|
|||||||
if (ci->clip) {
|
if (ci->clip) {
|
||||||
if (p_canvas_clip != nullptr) {
|
if (p_canvas_clip != nullptr) {
|
||||||
ci->final_clip_rect = p_canvas_clip->final_clip_rect.intersection(global_rect);
|
ci->final_clip_rect = p_canvas_clip->final_clip_rect.intersection(global_rect);
|
||||||
|
if (ci->final_clip_rect == Rect2()) {
|
||||||
|
// Clip rects do not intersect, so don't draw this item.
|
||||||
|
return;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
ci->final_clip_rect = global_rect;
|
ci->final_clip_rect = global_rect;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user