-
Notifications
You must be signed in to change notification settings - Fork 51
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
SVGs in corners with border radius are not aligned properly #79
Comments
Is it iOS? |
Also, please provide me a reproducible example in Expo Snack |
Web, iOS, and Android. I'll hopefully be able to work on a snack for you soon. |
Hi @SrBrahma I found the time to create a snack that exhibits the issue. The modal is opened with Let me know what you think or if there is another way I can help you out with this. |
The thing is that the borderRadius is handled differently by React Native styles and the SVG engine, and that engine depends on the platform. In that example, you can put the View with the white background as a child of the Shadow component, and change the paintInside to true. This way, any gap caused by the different borderRadiuses will just have the Shadow color filling it; the red won't be visible between the two components. |
Also, in your example, you can just simply put that white background color inside the |
Interesting, when I tried paint inside before I did not expect it to be underneath the
I will give your solution a try and see how it works in our environment. Cheers |
The solution you mentioned has worked for us and we've gone ahead with that for now. I wish there was some way I could have guessed this behavior and come up with the solution on my own. I did try Thanks again for your help. Maybe this would be worth adding to the FAQ section? |
I believe the reason it covered the whole component is because the white background you had was caused by the parent component, so the child component is rendered after the parent, that's why the paintInside was on top of the parent's background. Any idea how to write about that on the README? Either on FAQ or on the paintInside/style props description. |
We have a modal with a border radius of
15px
that renders on top of other content. The corners allow a small amount of bleed through of the content below inbetween the edge of the view and the start of the shadow. After digging in it looks like if I adjust the offset value just slightly down for the<Stop/>
components in the<RadialGradient/>
it appears to resolve the issue. There seems to be a bit of math involved in calculating those at this time, and I'm not really sure how to accomplish this programatically as I could only get it to work by tweaking things in the inspector.See this image below of an example of the bleed through between the edge of the view and the start of the shadow, the white card in the background comes in strongly.
The text was updated successfully, but these errors were encountered: