Skip to content

Commit

Permalink
Fix #388: fix fill for group with currentColor
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniil Manin committed May 20, 2019
1 parent c8c9505 commit 9a3c729
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Source/svg/SVGParser.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
}

Expand Down

0 comments on commit 9a3c729

Please sign in to comment.