mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-20 22:39:50 -05:00
Split PaperScope#remove() into #clear() and #remove(), so scopes can be reused.
This commit is contained in:
parent
593813660a
commit
30e3359d1d
1 changed files with 6 additions and 1 deletions
|
@ -42,7 +42,7 @@ var PaperScope = this.PaperScope = Base.extend({
|
|||
}, scope);
|
||||
},
|
||||
|
||||
remove: function() {
|
||||
clear: function() {
|
||||
// Remove all documents and tools.
|
||||
for (var i = this.documents.length - 1; i >= 0; i--)
|
||||
this.documents[i].remove();
|
||||
|
@ -50,6 +50,11 @@ var PaperScope = this.PaperScope = Base.extend({
|
|||
this.tools[i].remove();
|
||||
},
|
||||
|
||||
remove: function() {
|
||||
this.clear();
|
||||
delete PaperScope.scopes[this.id];
|
||||
},
|
||||
|
||||
statics: {
|
||||
scopes: {},
|
||||
|
||||
|
|
Loading…
Reference in a new issue