Skip to content

Commit

Permalink
Merge pull request #92763 from markdibarry/parallax2d_cull_fix
Browse files Browse the repository at this point in the history
Fix incorrect cull boundary for scaled and repeated Parallax2D children
  • Loading branch information
akien-mga committed Jun 12, 2024
2 parents 0dfe93b + f0983f1 commit 7571f82
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions servers/rendering/renderer_canvas_cull.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down

0 comments on commit 7571f82

Please sign in to comment.