From 1047f739a4e33e9b47df9fd2708a7b392145c589 Mon Sep 17 00:00:00 2001 From: Mikael Sand Date: Fri, 19 Oct 2018 02:47:43 +0300 Subject: [PATCH] [iOS] Fix handling of releaseCachedPath in Text --- ios/Brushes/RNSVGBrush.m | 5 +++++ ios/Text/RNSVGText.m | 20 +++++++++++++++++++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/ios/Brushes/RNSVGBrush.m b/ios/Brushes/RNSVGBrush.m index b5b64dcf..5ee3634c 100644 --- a/ios/Brushes/RNSVGBrush.m +++ b/ios/Brushes/RNSVGBrush.m @@ -18,6 +18,11 @@ RCT_NOT_IMPLEMENTED(- (instancetype)init) +- (void)paint:(CGContextRef)context opacity:(CGFloat)opacity painter:(RNSVGPainter *)painter bounds:(CGRect)bounds +{ + +} + - (BOOL)applyFillColor:(CGContextRef)context opacity:(CGFloat)opacity { return NO; diff --git a/ios/Text/RNSVGText.m b/ios/Text/RNSVGText.m index 721dcc62..7f179d16 100644 --- a/ios/Text/RNSVGText.m +++ b/ios/Text/RNSVGText.m @@ -18,12 +18,30 @@ RNSVGGlyphContext *_glyphContext; NSString *_alignmentBaseline; NSString *_baselineShift; + BOOL _merging; } - (void)invalidate { + if (_merging) { + return; + } [super invalidate]; - //[self releaseCachedPath]; + [self releaseCachedPath]; +} + +- (void)mergeProperties:(__kindof RNSVGRenderable *)target +{ + _merging = true; + [super mergeProperties:target]; + _merging = false; +} + +- (void)resetProperties +{ + _merging = true; + [super resetProperties]; + _merging = false; } - (void)setTextLength:(RNSVGLength *)textLength