-
Notifications
You must be signed in to change notification settings - Fork 24.3k
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
[ios] : Add allowsEdgeAntialiasing on views with rotations or skew tr… #32920
[ios] : Add allowsEdgeAntialiasing on views with rotations or skew tr… #32920
Conversation
Hi @Arkolos! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks! |
|
Base commit: a46a99e |
Base commit: a46a99e |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
@sshic has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
Any news on this? |
This pull request was successfully merged by Mattéo Martin in e6a3410. When will my fix make it into a release? | Upcoming Releases |
Summary: We should enable antialiasing when it's necessary, as it's an expensive property. Scale and Translate transforms shouldn't enable it. Source: facebook#32920 Changelog: [iOS][Changed] Matched behaviour for allowsEdgeAntialiasing to old architecture. Differential Revision: D50270444
Summary: We should enable antialiasing when it's necessary, as it's an expensive property. Scale and Translate transforms shouldn't enable it. Source: facebook#32920 Changelog: [iOS][Changed] Matched behaviour for allowsEdgeAntialiasing to old architecture. Reviewed By: sammy-SC Differential Revision: D50270444
Summary: We should enable antialiasing when it's necessary, as it's an expensive property. Scale and Translate transforms shouldn't enable it. Source: facebook#32920 Changelog: [iOS][Changed] Matched behaviour for allowsEdgeAntialiasing to old architecture. Reviewed By: sammy-SC Differential Revision: D50270444
Summary: We should enable antialiasing when it's necessary, as it's an expensive property. Scale and Translate transforms shouldn't enable it. Source: facebook#32920 Changelog: [iOS][Changed] Matched behaviour for allowsEdgeAntialiasing to old architecture. Reviewed By: sammy-SC Differential Revision: D50270444
Summary: Pull Request resolved: #40943 We should enable antialiasing when it's necessary, as it's an expensive property. Scale and Translate transforms shouldn't enable it. Source: #32920 Changelog: [iOS][Changed] Matched behaviour for allowsEdgeAntialiasing to old architecture. Reviewed By: sammy-SC Differential Revision: D50270444 fbshipit-source-id: 8a08039c42f8fb855db2ace140124c33f18dc3bc
…ansforms
Summary
On iOS, if a View is rotated with the a transform (e.g. <View style={{transform: {rotationZ: 5}}} />), the view has aliasing (see screenshot). Same for a skew transformation. We don't have the issue on Android
This behavior had originally being fixed by this PR #1999
However a new PR was merge ( #19360 ) that broke this. I think it was made to add antialiasing during perspective transforms but seems to have broken the antialiasing when rotationZ transforms
This PR adds back the antialising during rotation transform , while keeping it during perspective transform.
Changelog
I changed the allowsEdgeAntialiasing condition, making it "true" when the m12 or m21 is not 0. From this article https://medium.com/swlh/understanding-3d-matrix-transforms-with-pixijs-c76da3f8bd8 , I've understood that in all rotation or skew transformations, m12 or m21 is different than 0 . In the other transformation (e.g. scale or translate) it stays at 0.
Although, I'm not a matrix transformation expert so I may be mistaken
Test Plan
I've written several views with all rotateX/Y/Z , skewX,Y and perpective transformation. Before the PR some transformation was showing aliasing on iOS (e.g. top-left view in the screenshot, don't hesitate to zoom in the image if you don't see it) and with this PR it does not have anymore
Before
After
Code I used to test