mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-05 20:32:00 -05:00
Define default value for Item#_selected and copy it over when item is cloned.
This commit is contained in:
parent
2679d6eb9e
commit
c4b3d1c82a
1 changed files with 5 additions and 2 deletions
|
@ -222,7 +222,7 @@ var Item = this.Item = Base.extend({
|
|||
return true;
|
||||
}
|
||||
}
|
||||
return !!this._selected;
|
||||
return this._selected;
|
||||
},
|
||||
|
||||
setSelected: function(selected) {
|
||||
|
@ -236,6 +236,8 @@ var Item = this.Item = Base.extend({
|
|||
}
|
||||
},
|
||||
|
||||
_selected: false,
|
||||
|
||||
// TODO: isFullySelected / setFullySelected
|
||||
// TODO: Change to getter / setters for these below that notify of changes
|
||||
// through _changed()
|
||||
|
@ -612,7 +614,8 @@ var Item = this.Item = Base.extend({
|
|||
// Only copy over these fields if they are actually defined in 'this'
|
||||
// TODO: Consider moving this to Base once it's useful in more than one
|
||||
// place
|
||||
var keys = ['locked', 'visible', 'opacity', 'blendMode', '_clipMask'];
|
||||
var keys = ['locked', 'visible', 'opacity', 'blendMode', '_clipMask',
|
||||
'_selected'];
|
||||
for (var i = 0, l = keys.length; i < l; i++) {
|
||||
var key = keys[i];
|
||||
if (this.hasOwnProperty(key))
|
||||
|
|
Loading…
Reference in a new issue