mirror of
https://github.com/zoriya/react-native-svg.git
synced 2026-06-06 08:22:23 +00:00
fix: PlatformColor crashes on iOS and Android (#1703)
Follow-up PR to https://github.com/react-native-svg/react-native-svg/pull/1561 fixing the problems mentioned there. Also fixing the wrong releasing introduced in https://github.com/react-native-svg/react-native-svg/commit/027b8c16aa99267467b5aef0fcfd1aa8c2c8582a
This commit is contained in:
+4
-11
@@ -65,31 +65,24 @@ static CGFloat RNSVGTSpan_radToDeg = 180 / (CGFloat)M_PI;
|
||||
if (self.content) {
|
||||
RNSVGGlyphContext* gc = [self.textRoot getGlyphContext];
|
||||
if (self.inlineSize != nil && self.inlineSize.value != 0) {
|
||||
CGColorRef color;
|
||||
if (self.fill) {
|
||||
if (self.fill.class == RNSVGBrush.class) {
|
||||
color = [self.tintColor CGColor];
|
||||
CGColorRef color = [self.tintColor CGColor];
|
||||
[self drawWrappedText:context gc:gc rect:rect color:color];
|
||||
} else {
|
||||
color = [self.fill getColorWithOpacity:self.fillOpacity];
|
||||
CGColorRef color = [self.fill getColorWithOpacity:self.fillOpacity];
|
||||
[self drawWrappedText:context gc:gc rect:rect color:color];
|
||||
}
|
||||
if (color) {
|
||||
CGColorRelease(color);
|
||||
color = nil;
|
||||
}
|
||||
}
|
||||
if (self.stroke) {
|
||||
if (self.stroke.class == RNSVGBrush.class) {
|
||||
color = [self.tintColor CGColor];
|
||||
CGColorRef color = [self.tintColor CGColor];
|
||||
[self drawWrappedText:context gc:gc rect:rect color:color];
|
||||
} else {
|
||||
color = [self.stroke getColorWithOpacity:self.strokeOpacity];
|
||||
CGColorRef color = [self.stroke getColorWithOpacity:self.strokeOpacity];
|
||||
[self drawWrappedText:context gc:gc rect:rect color:color];
|
||||
}
|
||||
if (color) {
|
||||
CGColorRelease(color);
|
||||
color = nil;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user