From 0a52db1c8db94062f027570a04a0b4cbcb0eb167 Mon Sep 17 00:00:00 2001 From: Stephanie Sharp Date: Mon, 25 Jun 2018 17:18:47 -0400 Subject: [PATCH] Fix image clip path --- Source/svg/SVGParser.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/svg/SVGParser.swift b/Source/svg/SVGParser.swift index 290dad88..aa8b1972 100644 --- a/Source/svg/SVGParser.swift +++ b/Source/svg/SVGParser.swift @@ -1382,9 +1382,10 @@ open class SVGParser { } fileprivate func getClipPath(_ attributes: [String: String], locus: Locus?) -> Locus? { - if let clipPath = attributes["clip-path"], let id = parseIdFromUrl(clipPath), let locus = locus { + if let clipPath = attributes["clip-path"], let id = parseIdFromUrl(clipPath) { if let userSpaceLocus = defClip[id] { if !userSpaceLocus.userSpace { + guard let locus = locus else { return .none } let transform = transformBoundingBoxLocus(respectiveLocus: userSpaceLocus.locus, absoluteLocus: locus) return TransformedLocus(locus: userSpaceLocus.locus, transform: transform) }