Merge pull request #92763 from markdibarry/parallax2d_cull_fix

Fix incorrect cull boundary for scaled and repeated Parallax2D children
This commit is contained in:
Rémi Verschelde 2024-06-12 11:01:05 +02:00
commit 7571f82bea
No known key found for this signature in database
GPG Key ID: C3336907360768E1
1 changed files with 3 additions and 2 deletions

View File

@ -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);
}
}