mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-01 02:38:43 -05:00
Do not use #splice() for the initial push to the documents / children list.
This commit is contained in:
parent
8c2ad5f331
commit
a775e66632
2 changed files with 4 additions and 4 deletions
|
@ -59,8 +59,8 @@ var Document = this.Document = Base.extend({
|
|||
this.bounds = Rectangle.create(0, 0, this._size.width,
|
||||
this._size.height);
|
||||
this.context = this.canvas.getContext('2d');
|
||||
// Push it onto paper.documents and adjust index in one:
|
||||
Base.splice(paper.documents, [this]);
|
||||
// Push it onto paper.documents and set index:
|
||||
this._index = paper.documents.push(this) - 1;
|
||||
this.activate();
|
||||
this.layers = [];
|
||||
this.activeLayer = new Layer();
|
||||
|
|
|
@ -20,8 +20,8 @@ var Layer = this.Layer = Group.extend({
|
|||
initialize: function() {
|
||||
this.children = [];
|
||||
this._document = paper.document;
|
||||
// Push it onto document.layers and adjust index in one:
|
||||
Base.splice(this._document.layers, [this]);
|
||||
// Push it onto document.layers and set index:
|
||||
this._index = this._document.layers.push(this) - 1;
|
||||
this.activate();
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in a new issue