-
-
Notifications
You must be signed in to change notification settings - Fork 21.2k
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
Fix canvas rect bound calculation #49160
Conversation
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense to me!
I think reduz will have to double check as well. There may be a reason he only applied the transform to one command.
Yeah I agree to get reduz to take a look to confirm. It could have been that originally the transform did apply to just the first command, but looking at the code, I suspect it is just a late night bug that never got caught. |
Thanks! |
The same code seems to exist in |
Already done. 👍 |
Cherry-picked for 3.3.3. |
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.
Fixes #49156
Notes