Skip to content
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

Closed
liubko opened this issue Jun 9, 2015 · 7 comments
Closed

[View] Border radius greater than half of width/height works strange #1572

liubko opened this issue Jun 9, 2015 · 7 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@liubko
Copy link
Contributor

liubko commented Jun 9, 2015

  circle: {
    width: 50,
    height: 50,    
    borderRadius: 25
  }

with borderRadius greater than 25 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

@JonasJonny
Copy link

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.

@liubko
Copy link
Contributor Author

liubko commented Jun 9, 2015

@JonasJonny totally agree. Maybe it is not a bug at all, but I think most people will expect to get circle in that case.

@nicklockwood
Copy link
Contributor

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.

@ide
Copy link
Contributor

ide commented Jun 10, 2015

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/

@cgarvis
Copy link

cgarvis commented Jun 30, 2015

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.

@brentvatne
Copy link
Collaborator

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

nicklockwood added a commit that referenced this issue Jan 7, 2016
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
@brentvatne
Copy link
Collaborator

Fixed in b115277

christopherdro pushed a commit to wildlifela/react-native that referenced this issue Jan 20, 2016
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
@facebook facebook locked as resolved and limited conversation to collaborators Jul 22, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 22, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

7 participants