-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
Fixes UI glitch when drawing selective corners with borderRadius #19451
Fixes UI glitch when drawing selective corners with borderRadius #19451
Conversation
@sophiebits Can you help reviewing this? Or do you know someone who can? |
I already tested it on a iPhone 5 and 5s, I just also tested on a iPhone 7 plus and iPhone X and it works. However, on these 3x devices the glitch never manifested but at least I can confirm that everything still works as expected on these devices. I'm not sure how to test 1x though... I might have to get my hands on an 1st gen iPad mini which runs iOS 9 and has a screen scale of 1x. |
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.
Approved. Please rebase in order to take care of the test failures. They're unrelated to your diff, but rebasing should bring them back to green on this PR.
On devices (not simulator) running iOS 11 there seems to be a bug when drawing selective borders with a corner radius. A "bleeding" line appears on corners that don't have a radius while an adjacent corner has. It’s most likely a bug with iOS 11 itself as the original code is according to spec and it works fine in an iOS 11 simulator. However it turns out that this patch is a workaround for this problem. This patch increases the stretchable area to 2pt instead of 1pt after witch the glitch dissappears. I assume shouldn’t have a negative performance impact as it also enforces resizingMode UIImageResizingModeStretch.
Done. Tests are passing again. |
Revisit after this PR merged to RN - facebook/react-native#19451
Sorry @jamesreggio I didn't have the test readily available for re-creating the "intermediate"-state images that I used for my PR. But I think your PR has a proper solution compared to the workaround I used in my PR. Nice work! 👍 Good to see that it landed in master now! |
Fixes #11897
On devices (not simulator) running iOS 11 there seems to be a bug when drawing selective borders with a corner radius. A "bleeding" line appears on corners that don't have a radius while an adjacent corner has.
It’s most likely a bug with iOS 11 itself as the original code is according to spec and it works fine in an iOS 11 simulator. However it turns out that this patch is a workaround for this problem.
This patch increases the stretchable area to 2pt instead of 1pt after which the glitch disappears. I assume shouldn’t have a negative performance impact as it also enforces resizingMode UIImageResizingModeStretch.
In all fairness, though this workaround seems to have a positive impact on the bug, the exact reason why some cap inset areas are partially stretched across the resizable area remains unknown to me.
Screenshots:
The screenshots below are created using an iPhone 5s Device (e.g. in simulator the bug doesn't manifest):
From left to right:
Before fix:
After fix:
As you can see, there is still some bleeding happening but not in the final result.
Test Plan
See #11897 (comment)
Release Notes
[IOS] [BUGFIX] [View] - Fixes bleeding corner borders on iOS 11 devices