Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[4.x] Fix canvas rect bound calculation #49161

Merged
merged 1 commit into from
May 31, 2021

Conversation

lawnjelly
Copy link
Member

@lawnjelly lawnjelly commented May 28, 2021

It turns out the calculation of the bounding rect for canvas items has a nasty bug. When a transform is applied (especially in a custom draw), in the renderer this extra matrix is applied to all later commands in the canvas item. However in the calculation of the bound, the transform is only applied to the first command following the transform.

This PR fixes this inconsistency.

Version of #49160 for Godot 4.x.

Notes

  • This could do with testing in Godot 4, but it should work the same as in 3.x, providing the vulkan renderer has not changed the behaviour of transform commands.

It turns out the calculation of the bounding rect for canvas items has a nasty bug. When a transform is applied (especially in a custom draw), in the renderer this extra matrix is applied to all later commands in the canvas item. However in the calculation of the bound, the transform is only applied to the first command following the transform.

This PR fixes this inconsistency.
@lawnjelly lawnjelly requested a review from a team as a code owner May 28, 2021 08:07
@Calinou Calinou added this to the 4.0 milestone May 28, 2021
@akien-mga akien-mga merged commit 52ab531 into godotengine:master May 31, 2021
@akien-mga
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants