From f0983f1b1c1638e8344b7d0ce90d9091489333f3 Mon Sep 17 00:00:00 2001 From: markdibarry Date: Tue, 4 Jun 2024 11:52:34 -0400 Subject: [PATCH] Add cull fix for scale repeat --- servers/rendering/renderer_canvas_cull.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/servers/rendering/renderer_canvas_cull.cpp b/servers/rendering/renderer_canvas_cull.cpp index 42de831e7a4..f8722194256 100644 --- a/servers/rendering/renderer_canvas_cull.cpp +++ b/servers/rendering/renderer_canvas_cull.cpp @@ -272,8 +272,9 @@ void RendererCanvasCull::_cull_canvas_item(Item *p_canvas_item, const Transform2 ci->repeat_times = repeat_times; if (repeat_size.x || repeat_size.y) { - rect.size += repeat_size * repeat_times / final_xform.get_scale(); - rect.position -= repeat_size * (repeat_times / 2); + Size2 scale = final_xform.get_scale(); + rect.size += repeat_size * repeat_times / scale; + rect.position -= repeat_size / scale * (repeat_times / 2); } }