Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pixie SVG does not support clipPath #301

Open
1jss opened this issue Oct 9, 2021 · 3 comments
Open

Pixie SVG does not support clipPath #301

1jss opened this issue Oct 9, 2021 · 3 comments

Comments

@1jss
Copy link

1jss commented Oct 9, 2021

I was trying to draw one of my SVGs, but got the following error:

Error: unhandled exception: Unsupported SVG tag: clipPath [PixieError]

Simple test image that generates the error:

<?xml version="1.0" encoding="UTF-8"?>
<svg clip-rule="evenodd" fill-rule="evenodd" version="1.1" viewBox="0 0 140 140" xml:space="preserve" xmlns="http://www.w3.org/2000/svg">
<rect x="20" y="20" width="100" height="100"/>
<clipPath id="a">
 <rect x="20" y="20" width="100" height="100"/>
</clipPath>
<g clip-path="url(#a)">
 <rect x="40" y="40" width="100" height="100" fill="#f00"/>
</g></svg>

I don't know if the current plan is to use Cairo for SVGs, but I thought I would create an issue anyways.

How hard would it be implementing clipPath given that we already have masks in the drawing library?

@guzba
Copy link
Collaborator

guzba commented Oct 9, 2021

SVG is impossibly complex unfortunately, we certainly do not support everything. This looks like one of the tags we do not support yet. I add support for more things every now and then as I find SVG examples of them. I don't think clipPath would be particularly difficult to add fortunately.

@1jss
Copy link
Author

1jss commented Oct 9, 2021

Definitely! You guys are heroes for building this!

I have read the svg.nim to figure out how it was built, but I haven't understood it well enough yet to try to implement clipPath myself. Will try to wrap my head around it and give it a go.

@guzba
Copy link
Collaborator

guzba commented Oct 9, 2021

No problem. The svg.nim file is certainly not the cleanest file we have since SVG is always in-flux, hard to clean up something always getting more complicated haha. If you do manage a PR that'd be great, otherwise it is something I can work on next time I do SVG work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants