-
-
Notifications
You must be signed in to change notification settings - Fork 452
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
Broken remove on two #15
Comments
Thanks for mentioning this. Remove was one of the latest things I've put in and as such is probably the buggiest. I'll look into this right away. |
So on further inspection. _.each(two.scene.children, function(child) {
child.remove();
}); Be mindful of removing any references in your own code to shapes and groups in order for the browser to properly garbage collect these. |
Would be good to document this use somewhere in the API, the two descriptions of |
No problem. Indeed — I think I'm gonna craft the api like that. I can update this on the documentation, but yes, group.remove(circle); // Removes the circle
group.remove(circle, rect); // Removes circle and rect
group.remove([circle, rect]); // Removes circle and rect
group.remove(); // Removes the group itself |
Added and in the latest build: a5c08c4 |
Adding
on line 15 of the first example and pressing enter couple times breaks havoc (rectangle is rendered without fill and on each redraw the scene is shifted to the right).
Secondly, is there any way to completely wipe Two's instance and start anew? Unfortunately, now Two is unusable in situations when I want to draw dynamically, different objects into the same location. Or something like
two.clear()
.The text was updated successfully, but these errors were encountered: