Skip to content

Commit

Permalink
fix: extraction of clip rule, fixes #1233
Browse files Browse the repository at this point in the history
  • Loading branch information
msand committed Jan 3, 2020
1 parent 3bf07f8 commit f93bdde
Showing 1 changed file with 12 additions and 16 deletions.
28 changes: 12 additions & 16 deletions src/lib/extract/extractProps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 +
'"',
);
}
}

Expand Down

0 comments on commit f93bdde

Please sign in to comment.