-
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
[View] Border radius greater than half of width/height works strange #1572
Comments
From CSS, border-radius should be half of width/height. If you set bigger value, then browser render the circle anyway but it is not a good practice. Maybe react-native is the same. |
@JonasJonny totally agree. Maybe it is not a bug at all, but I think most people will expect to get circle in that case. |
We aim to follow the CSS spec as closely as possible with the border styles, even if the spec is weird. If it's behaving differently from a spec-compliant browser like Chrome then it may be a bug, otherwise it's as intended. |
The spec says to prevent overlapping which is what produces the circle effect: http://www.w3.org/TR/css3-background/#corner-overlap. If you were to set a 50pt radius on just one corner it should produce a quarter-circle: https://jsfiddle.net/36uax3oL/1/ |
Just ran into this. In 0.5.0, borderRadius equal to the width/height got me a circle. Upgrading to 0.6.0 cause that break. |
Hi there! This issue is being closed because it has been inactive for a while. But don't worry, it will live on with ProductPains! Check out it's new home: https://productpains.com/post/react-native/view-border-radius-greater-than-half-of-widthheight-works-strange |
Summary: public The iOS border rendering code did not follow the CSS spec in cases where the sum of adjacent border radii was greater than the width of the view, resulting in drawing glitches such as pixel smear and borders appearing stretched or squashed. This diff brings our implementation closer to spec-compliance in these cases. I also fixed a longstanding issue with ghostly diagonal lines appearing at the corners due to antialiasing rounding errors! Fixes #1572 #2089 #4604 Reviewed By: tadeuzagallo Differential Revision: D2811249 fb-gh-sync-id: c3dd2721e0a01a432fa4dc78daa05680595edd08
Fixed in b115277 |
Summary: public The iOS border rendering code did not follow the CSS spec in cases where the sum of adjacent border radii was greater than the width of the view, resulting in drawing glitches such as pixel smear and borders appearing stretched or squashed. This diff brings our implementation closer to spec-compliance in these cases. I also fixed a longstanding issue with ghostly diagonal lines appearing at the corners due to antialiasing rounding errors! Fixes facebook#1572 facebook#2089 facebook#4604 Reviewed By: tadeuzagallo Differential Revision: D2811249 fb-gh-sync-id: c3dd2721e0a01a432fa4dc78daa05680595edd08
with
borderRadius
greater than25
it isn't going to be a circle anymore.I made a Demo https://rnplay.org/apps/vj3mJQ
You could reproduce it in react v.0.0.6-rc
The text was updated successfully, but these errors were encountered: