mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-06-28 05:50:26 -04:00
Start implementing ChangeFlags.ATTRIBUTE and ChangeFlags.APPEARANCE.
This commit is contained in:
parent
c4b51209f3
commit
f0664f50e6
2 changed files with 6 additions and 4 deletions
src/item
|
@ -17,6 +17,8 @@
|
|||
var ChangeFlags = {
|
||||
GEOMETRY: 1, // Item geometry (path, bounds)
|
||||
STROKE: 2, // Stroke geometry (excluding color)
|
||||
STYLE: 4, // Fille style or stroke color / dash,
|
||||
HIERARCHY: 8 // Change in item hierarchy
|
||||
STYLE: 4, // Fill style or stroke color / dash,
|
||||
APPEARANCE: 8, // Visible item attributes: visible, blendMode, opacity ...
|
||||
ATTRIBUTE: 16, // Any attributes, also inviislbe ones: locked, name, ...
|
||||
HIERARCHY: 32 // Change in item hierarchy
|
||||
};
|
||||
|
|
|
@ -235,6 +235,7 @@ var Item = this.Item = Base.extend({
|
|||
this._selected = selected;
|
||||
this._project._updateSelection(this);
|
||||
}
|
||||
this._changed(ChangeFlags.ATTRIBUTE | ChangeFlags.APPEARANCE);
|
||||
},
|
||||
|
||||
_selected: false,
|
||||
|
@ -243,8 +244,6 @@ var Item = this.Item = Base.extend({
|
|||
// TODO: Change to getter / setters for these below that notify of changes
|
||||
// through _changed()
|
||||
|
||||
// TODO: Item#isLocked is currently ignored in the documentation, as
|
||||
// locking an item currently has no effect
|
||||
/**
|
||||
* Specifies whether the item is locked.
|
||||
*
|
||||
|
@ -294,6 +293,7 @@ var Item = this.Item = Base.extend({
|
|||
this.setFillColor(null);
|
||||
this.setStrokeColor(null);
|
||||
}
|
||||
this._changed(ChangeFlags.ATTRIBUTE | ChangeFlags.APPEARANCE);
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue