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

[Borders] Lines visible with borderRadius, borderWidth and borderColor #2089

Closed
jeanregisser opened this issue Jul 22, 2015 · 6 comments
Closed
Labels
Platform: iOS iOS applications. Resolution: Locked This issue was locked by the bot.

Comments

@jeanregisser
Copy link
Contributor

There's a rendering issue when using borderRadius, borderWidth and borderColor, you see lines appearing between each border:

screen shot 2015-07-22 at 14 22 01

The above image was produced with the following code on the latest master (75b220d), same happens with the latest released version (0.7.1):

'use strict';

var React = require('react-native');
var {
  AppRegistry,
  StyleSheet,
  Text,
  View,
} = React;

var SampleApp = React.createClass({
  render: function() {
    return (
      <View style={styles.container}>
        <View style={styles.circle}/>
      </View>
    );
  }
});

var styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
    backgroundColor: '#F5FCFF',
  },
  circle: {
    width: 100,
    height: 100,
    borderRadius: 50,
    borderWidth: 20,
    borderColor: 'green',
  },
});

AppRegistry.registerComponent('SampleApp', () => SampleApp);
@browniefed
Copy link
Contributor

Yep, this is reported here #2017
Edit: At least it appears to be a similar issue. borders + roundness = sadness on IOS

@browniefed
Copy link
Contributor

You can possibly accomplish the same with 2 circles? https://rnplay.org/apps/dhvHVw

@brentvatne brentvatne changed the title Lines visible with borderRadius, borderWidth and borderColor [Borders] Lines visible with borderRadius, borderWidth and borderColor Jul 22, 2015
@ide
Copy link
Contributor

ide commented Jul 22, 2015

This looks different than #2017. My initial guess is that this is a bug w Facebook rendering while 2017 is about apple rendering.

@a2
Copy link
Contributor

a2 commented Aug 10, 2015

The visible lines are due to the anti-aliasing when drawing the four trapezoids for the border. Not quite sure how to make them less visible without drawing the image at an unnecessarily larger scale and downsizing the image to be drawn.

@rjoonas
Copy link

rjoonas commented Nov 17, 2015

Another example of rendering glitches that appear when using both border width and border radius on React Native 0.14.2:

Screenshot Code
img_0003 <View style={{ backgroundColor: '#e6e6e6', borderWidth: 1, width: 70, height: 70, borderTopLeftRadius: 10 }}></View>
img_0004 <View style={{ backgroundColor: '#e6e6e6', width: 70, height: 70, borderTopLeftRadius: 10 }}></View>

This glitch is only visible when I run the app on my device, not in iOS simulator. If nested inside a ScrollView, the glitch lines flicker around when scrolling.

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
Platform: iOS iOS applications. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

7 participants