Skip to content

Instantly share code, notes, and snippets.

@benawad
Last active May 6, 2023 14:55
Show Gist options
  • Save benawad/01d7e6e3f108f52d88cba17a10526b63 to your computer and use it in GitHub Desktop.
Save benawad/01d7e6e3f108f52d88cba17a10526b63 to your computer and use it in GitHub Desktop.
// I'm trying to get paths with clip-rule to work. Example:
// <path fill-rule="evenodd" clip-rule="evenodd" d="M148 62.5C148" />
// this works
const p = Skia.Path.MakeFromSVGString(`<path fill-rule="evenodd" clip-rule="evenodd" d="M148 62.5C148" />`)
const frame0 = {
props: {
"fillRule": "evenodd",
"clipRule": "evenodd",
"d": "M148 62.5C148"
}
}
// this currently does not work
const start = useMemo(() => {
const p = Skia.Path.MakeFromSVGString(frame0.props.d)!;
if (frame0.props.fillRule) {
p.setFillType(FillType.EvenOdd);
}
return p;
}, []);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment