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

Rect does not recognize both rx and ry props #1112

Closed
brittrestine opened this issue Sep 20, 2019 · 3 comments
Closed

Rect does not recognize both rx and ry props #1112

brittrestine opened this issue Sep 20, 2019 · 3 comments
Labels

Comments

@brittrestine
Copy link

brittrestine commented Sep 20, 2019

Bug

When using Rect I am unable to get both rx and ry props to work as anticipated. As shown in the code below, I am trying to maintain the curve of rx to 20 and would like ry to have no curve at all, therefor I set it to 0.

Environment info

Library version: 9.9.3

Steps To Reproduce

  1. Added a Rect inside SVG
  2. Add rx="20" and ry="0" props to Rect
    ...

Describe what you expected to happen:

  1. I anticipated that the left side of my rect would be curved 20px and the right side have no curve at all

Reproducible sample code

<Svg width={250} height={50} style={{ alignSelf: 'center' }}>
      <Rect width="100%" height={50} fill={pink} opacity="0.20" rx="20" ry="0" />
      <Rect width={20} height={50} fill={red} rx="20" ry="0" />
      <SVGText
        fontSize="16"
        fontWeight="600"
        x="80%
        y="70%"
        fill={white}
      >
        {20}
      </SVGText>
    </Svg>

•As you can see below both sides of the rect are curved
image

@msand
Copy link
Collaborator

msand commented Sep 27, 2019

Can you try with c12d66e

@msand msand added the bug label Sep 27, 2019
@msand msand closed this as completed in c12d66e Sep 28, 2019
msand pushed a commit that referenced this issue Sep 28, 2019
## [9.9.7](v9.9.6...v9.9.7) (2019-09-28)

### Bug Fixes

* add gradientTransform to d.ts ([3f08c46](3f08c46)), closes [#1069](#1069)
* handling of gradients without stops ([18828c0](18828c0)), closes [#1099](#1099)
* handling of rounded rect ([c12d66e](c12d66e)), closes [#1112](#1112)
* units in linear and radial gradients ([70c54e6](70c54e6)), closes [#1110](#1110) [#1118](#1118)
@msand
Copy link
Collaborator

msand commented Sep 28, 2019

🎉 This issue has been resolved in version 9.9.7 🎉

The release is available on:

Your semantic-release bot 📦🚀

@msand msand added the released label Sep 28, 2019
@HilSny
Copy link

HilSny commented Oct 2, 2019

Hi @msand we are still seeing this issue in the latest release

<Rect width={f.percentify(percentToUse)} height={height} fill={palette[metric]} rx={20} ry={0} />

Screen Shot 2019-10-02 at 11 17 39 AM

what it looks on web:
Screen Shot 2019-10-02 at 11 38 41 AM

JackWillie added a commit to JackWillie/react-native-svg that referenced this issue Nov 27, 2022
## [9.9.7](software-mansion/react-native-svg@v9.9.6...v9.9.7) (2019-09-28)

### Bug Fixes

* add gradientTransform to d.ts ([3f08c46](software-mansion/react-native-svg@3f08c46)), closes [#1069](software-mansion/react-native-svg#1069)
* handling of gradients without stops ([18828c0](software-mansion/react-native-svg@18828c0)), closes [#1099](software-mansion/react-native-svg#1099)
* handling of rounded rect ([c12d66e](software-mansion/react-native-svg@c12d66e)), closes [#1112](software-mansion/react-native-svg#1112)
* units in linear and radial gradients ([70c54e6](software-mansion/react-native-svg@70c54e6)), closes [#1110](software-mansion/react-native-svg#1110) [#1118](software-mansion/react-native-svg#1118)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants