diff options
author | Darren Kaste <darrenkaste@gmail.com> | 2021-12-22 12:45:35 -0500 |
---|---|---|
committer | Darren Kaste <darrenkaste@gmail.com> | 2022-01-09 18:15:46 -0500 |
commit | b0d9e141551efe6c1e632b8e45139385f2cbfe70 (patch) | |
tree | 8ac96c0a7d483cbc21ddf97779f5d2b195037aa1 /servers/rendering | |
parent | 5f7c1081a77433409c41fd9f4a0eb1fc2f791a4f (diff) |
Fix canvas items being drawn outside clip rects
Diffstat (limited to 'servers/rendering')
-rw-r--r-- | servers/rendering/renderer_canvas_cull.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/servers/rendering/renderer_canvas_cull.cpp b/servers/rendering/renderer_canvas_cull.cpp index 02af3c6eb9..f5e2cbcd6c 100644 --- a/servers/rendering/renderer_canvas_cull.cpp +++ b/servers/rendering/renderer_canvas_cull.cpp @@ -261,6 +261,10 @@ void RendererCanvasCull::_cull_canvas_item(Item *p_canvas_item, const Transform2 if (ci->clip) { if (p_canvas_clip != nullptr) { 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 { ci->final_clip_rect = global_rect; } |