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

SVG.clear() removes <defs/> #18

Closed
WarWithinMe opened this issue Mar 28, 2013 · 5 comments
Closed

SVG.clear() removes <defs/> #18

WarWithinMe opened this issue Mar 28, 2013 · 5 comments

Comments

@WarWithinMe
Copy link

SVG.clear() removes everything inside the svg document. Elements created internally by svg.js should not be removed.

This bug leads to unable to create mask after calling SVG.clear()

@WarWithinMe
Copy link
Author

Maybe we should also clear the children of when SVG.clear() is called

@wout
Copy link
Member

wout commented Mar 28, 2013

I see. The problem is that the defs node is deleted but the reference is retained. If the reference is removed as well the defs will be automatically re-created. I will fix this asap.

@wout
Copy link
Member

wout commented Mar 28, 2013

This bug has been fixed and released as v0.11-7. After clearing the canvas defs are now recreated.

@wout wout closed this as completed Mar 28, 2013
@blq
Copy link

blq commented May 3, 2013

I think this issue should be reopened. Clear will not recreate the defs node (checked in 0.14 and 0.15). The "this._defs" field needs to be set to null before recreating with defs() in clear() otherwise the previous, but now orphaned, defs will be returned.

@wout
Copy link
Member

wout commented May 8, 2013

Thanks for reporting this. It will be fixed in the next release.

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

3 participants