From f93bdde26fd96944e20bb84fbcf3d4f9fd58eda3 Mon Sep 17 00:00:00 2001 From: Mikael Sand Date: Sat, 4 Jan 2020 01:19:02 +0200 Subject: [PATCH] fix: extraction of clip rule, fixes #1233 --- src/lib/extract/extractProps.ts | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/src/lib/extract/extractProps.ts b/src/lib/extract/extractProps.ts index 376e0af3c..2f4546ff6 100644 --- a/src/lib/extract/extractProps.ts +++ b/src/lib/extract/extractProps.ts @@ -117,23 +117,19 @@ export default function extractProps( extracted.name = String(id); } + if (clipRule) { + extracted.clipRule = clipRules[clipRule] === 0 ? 0 : 1; + } if (clipPath) { - if (clipRule) { - extracted.clipRule = clipRules[clipRule] === 0 ? 0 : 1; - } - - if (clipPath) { - const matched = clipPath.match(idPattern); - - if (matched) { - extracted.clipPath = matched[1]; - } else { - console.warn( - 'Invalid `clipPath` prop, expected a clipPath like "#id", but got: "' + - clipPath + - '"', - ); - } + const matched = clipPath.match(idPattern); + if (matched) { + extracted.clipPath = matched[1]; + } else { + console.warn( + 'Invalid `clipPath` prop, expected a clipPath like "#id", but got: "' + + clipPath + + '"', + ); } }