From b19a7d144fb4ebcab397225086c74a3a69ee645b Mon Sep 17 00:00:00 2001 From: Horcrux Date: Fri, 13 Jan 2017 16:47:25 +0800 Subject: [PATCH] Fix brush fill with stroke --- ios/RNSVGRenderable.m | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/ios/RNSVGRenderable.m b/ios/RNSVGRenderable.m index 021162d0..ba97d0e7 100644 --- a/ios/RNSVGRenderable.m +++ b/ios/RNSVGRenderable.m @@ -213,15 +213,22 @@ CGContextSetLineDash(context, self.strokeDashoffset, dash.array, dash.count); } - BOOL strokeColor = [self.stroke applyStrokeColor:context opacity:self.strokeOpacity]; - - if (!fillColor || !strokeColor) { + if (!fillColor) { CGContextAddPath(context, path); CGContextReplacePathWithStrokedPath(context); CGContextClip(context); } - if (!strokeColor) { + if (![self.stroke applyStrokeColor:context opacity:self.strokeOpacity]) { + // draw fill + CGContextAddPath(context, path); + CGContextDrawPath(context, mode); + + // draw stroke + CGContextAddPath(context, path); + CGContextReplacePathWithStrokedPath(context); + CGContextClip(context); + [self.stroke paint:context opacity:self.strokeOpacity brushConverter:[[self getSvgView] getDefinedBrushConverter:self.stroke.brushRef]