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

Fix nested SVGs in iOS #1437 #1603

Conversation

tiredBlueWhale
Copy link

@tiredBlueWhale tiredBlueWhale commented Jun 16, 2021

Summary

Fixes #1437 #1495.
Nested SVGs with gradients are rendered now in iOS

In the current implementation nested SVGs don't call the [svg parseReference]; which is needed for the brush creation.
This happens because of this if-clause RNSVGSvgView.m:208-210.

Moved the call of [svg parseReference]; from - (void)drawRect:(CGRect)rect to
- (void)drawToContext:(CGContextRef)context withRect:(CGRect)rect .
Since it also loops through the subviews and is called for all SVGs.

Test Plan

Code shown in #1437.

Compatibility

OS Implemented
iOS
Android

Checklist

  • I have tested this on a device and a simulator
  • I added documentation in README.md
  • I updated the typed files (typescript)
  • I added a test for the API in the __tests__ folder

@WoLewicki WoLewicki changed the base branch from develop to main December 21, 2022 13:52
@WoLewicki WoLewicki linked an issue Dec 21, 2022 that may be closed by this pull request
@WoLewicki
Copy link
Member

Closing since #1948 has been merged.

@WoLewicki WoLewicki closed this Jan 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants