-
-
Notifications
You must be signed in to change notification settings - Fork 790
Fix reset_transform in Cocoa/iOS #4045
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
base: main
Are you sure you want to change the base?
Conversation
|
This is odd... from both Linux Wayland Gtk4 tests (with and without adwaita): And the screenshot on Linux Wayland Gtk3 is just... entirely transparent. Great. Edit: didn't realize some platforms don't support Window.as_image(). That's fine, I should only be testing that step on Cocoa and iOS anyway. |
| ) | ||
|
|
||
| inverse_transform = core_graphics.CGAffineTransformInvert(transform) | ||
| if inverse_transform == transform: |
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.
This is also true for the identity transform and a few others which are their own inverses (like (-1, 0, 0, -1, 0, 0) and (-1, 0, 0, 1, 0, 0)).
Edit: to be constructive, I think it suffices to check if the determinant a * d - b * c == 0.
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.
Hm. As I understand it, if the transform (relative to the original) is the identity matrix, then the current would equal the original and we would've already exited. But I hadn't actually realized other matrices are their own inverse as well, thanks! Math is wild.
Fixes #4044
Adding the test first...
So far I have a fix that seems to work for Cocoa, but breaks iOS in new and interesting ways.
PR Checklist: