mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-08-10 21:19:10 -04:00
Fix project.clear() so it removes all layers properly.
This commit is contained in:
parent
ca0513b1b2
commit
68626ca62b
2 changed files with 11 additions and 2 deletions
src/project
|
@ -84,7 +84,7 @@ var Project = PaperScopeItem.extend(/** @lends Project# */{
|
|||
// DOCS: Project#clear()
|
||||
|
||||
clear: function() {
|
||||
for (var i = 0; i < this.layers.length; i++)
|
||||
for (var i = this.layers.length - 1; i >= 0; i--)
|
||||
this.layers[i].remove();
|
||||
this.symbols = [];
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue