-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Clone with SVG is not saving paths after load #3635
Comments
I do not know how the gif could help. |
@asturur Sorry, you're right. I have a working demo here: http://codepen.io/paulcredmond/pen/GrrPJP If you add some SVGs using the addsvg button, then move them around and undo/redo you'll notice they disappear, but the fabric objects can still be selected on the canvas.
|
I think this is why people use things like immutable js or similar this is the fromObject code. Using JSON and PARSE gives you a clone of the object everytime so you are safe. |
maybe is a bug since it can be addressed in the PathGroup constructor. |
Thanks @asturur |
Version: 1.7.3
Test Case
SVG image is cloned and saved with
toJSON();
As you can see in the gif, a non-SVG object is restored no problem (rectangle in this example). But the SVG clones don't have their path data when they are restored after load. But they do weirdly pop in again at the end, no idea why.
Steps to reproduce
fabric.loadSVGFromURL()
fabric.util.groupSVGElements()
.clone()
.toJSON()
loadFromDatalessJSON()
paths[0]
.renderAll()
after load, so that's not the issueExpected Behavior
Clone of an SVG is restored with copied paths.
Actual Behavior
SVG clone does not have any paths.
The text was updated successfully, but these errors were encountered: