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

Border-radius clipping incorrectly calculated #279

Closed
kdzwinel opened this issue Mar 6, 2018 · 1 comment · Fixed by #413
Closed

Border-radius clipping incorrectly calculated #279

kdzwinel opened this issue Mar 6, 2018 · 1 comment · Fixed by #413
Labels

Comments

@kdzwinel
Copy link

kdzwinel commented Mar 6, 2018

| -------------------------------------------------------------------------------------------------

Reporting a bug or issue

Example code below doesn't render as expected. Border is rendered partially behind the image. In this specific case setting borderRadius: 100 on the Image fixes the issue, but it won't work in general case (e.g. with multiple elements inside of the View).

<Artboard style={{width: 800, height: 600}}>
  <View style={{overflow: 'hidden', borderColor: 'red', borderWidth: 1, borderRadius: 100, width: 120, height: 120}}>
    <Image style={{width: 118, height: 118}} source={{uri: 'https://source.unsplash.com/240x240/?dog'}} />
  </View>
</Artboard>

Expected behavior:

screen shot 2018-03-06 at 12 55 24

Observed behavior:

screen shot 2018-03-06 at 12 54 55

How to reproduce:
Render attached code using react-sketchapp (v1.0.0).

Sketch version:

49 (51002)

Please attach screenshots, a zip file of your project, and/or a link to your github project

@kdzwinel
Copy link
Author

kdzwinel commented Mar 6, 2018

It looks like it's fixable by subtracting border size from the clipping shape and setting border position to "outside".

screen shot 2018-03-06 at 13 17 10

mathieudutour added a commit that referenced this issue Feb 12, 2019
* fix overrides and images on nodejs

* Fix Border-radius clipping incorrectly calculated (#279)

* fix setting text override

* version 3.0.0-beta-3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants