mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-19 06:00:56 -05:00
Allow better code compression by removing repeated variable access on this.
This commit is contained in:
parent
35a02f3dd8
commit
8b4f59962e
1 changed files with 5 additions and 4 deletions
|
@ -85,14 +85,15 @@ var Layer = Group.extend(/** @lends Layer# */{
|
|||
if (this._parent)
|
||||
return _remove.base.call(this, notify);
|
||||
if (this._index != null) {
|
||||
if (this._project.activeLayer === this)
|
||||
this._project.activeLayer = this.getNextSibling()
|
||||
var project = this._project;
|
||||
if (project.activeLayer === this)
|
||||
project.activeLayer = this.getNextSibling()
|
||||
|| this.getPreviousSibling();
|
||||
Base.splice(this._project.layers, null, this._index, 1);
|
||||
Base.splice(project.layers, null, this._index, 1);
|
||||
this._installEvents(false);
|
||||
// Tell project we need a redraw. This is similar to _changed()
|
||||
// mechanism.
|
||||
this._project._needsUpdate = true;
|
||||
project._needsUpdate = true;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
Loading…
Reference in a new issue