You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Something seems to be working incorrectly with the importing->parsing->serializing->exporting flow for SVG path commands.
Here I'm creating a new paper.Path(pathA.getAttribute("d")) from a given SVG, then using paper.project.exportSVG({}) to generate an export. Even for simple shapes like this outlined circle and square, something seems to be working incorrectly, possibly involving how the close path is handled?
I'm not familiar with how these commands are processed internally so I'm not sure how best to debug this further.
I found that the issue here is I was using paper.Path instead of paper.CompoundPath. It seems that if you give the normal Path a pathData string containing multiple separate paths, it joins the end of each together.
It seems like this should either:
throw an error
log some sort of warning
automatically create a CompoundPath instead
only include one (probably the first?) shape in the pathData
Description/Steps to reproduce
Something seems to be working incorrectly with the importing->parsing->serializing->exporting flow for SVG path commands.
Here I'm creating a
new paper.Path(pathA.getAttribute("d"))
from a given SVG, then usingpaper.project.exportSVG({})
to generate an export. Even for simple shapes like this outlined circle and square, something seems to be working incorrectly, possibly involving how the close path is handled?I'm not familiar with how these commands are processed internally so I'm not sure how best to debug this further.
Link to reproduction test-case
https://codesandbox.io/p/sandbox/paperjs-imp-exp-rn5qt2
Expected result
The imported path should be exported in a visually identical way.
Additional information
macOS 13.6, Safari 17.0
The text was updated successfully, but these errors were encountered: