From 9a3c7293f3d418c174ac0f686e39e5eb9f2e0e65 Mon Sep 17 00:00:00 2001 From: Daniil Manin Date: Mon, 20 May 2019 17:05:45 +0700 Subject: [PATCH] Fix #388: fix fill for group with currentColor --- Source/svg/SVGParser.swift | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Source/svg/SVGParser.swift b/Source/svg/SVGParser.swift index 2b21bd02..9384a6d7 100644 --- a/Source/svg/SVGParser.swift +++ b/Source/svg/SVGParser.swift @@ -571,9 +571,14 @@ open class SVGParser { } } + let hasCurrentColor = styleAttributes["fill"] == "currentColor" + self.availableStyleAttributes.forEach { availableAttribute in if let styleAttribute = element.allAttributes[availableAttribute]?.text, styleAttribute != "inherit" { - styleAttributes.updateValue(styleAttribute, forKey: availableAttribute) + + if !hasCurrentColor || availableAttribute != "color" { + styleAttributes.updateValue(styleAttribute, forKey: availableAttribute) + } } }