mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-22 07:19:57 -05:00
Add a bit more documentation to the Color owner stuff.
This commit is contained in:
parent
42e8f787ee
commit
266c78f4eb
1 changed files with 4 additions and 0 deletions
|
@ -311,6 +311,8 @@ var Color = this.Color = Base.extend(new function() {
|
||||||
*/
|
*/
|
||||||
_changed: function() {
|
_changed: function() {
|
||||||
this._cssString = null;
|
this._cssString = null;
|
||||||
|
// Loop through the items that use this color and notify them about
|
||||||
|
// the style change, so they can redraw.
|
||||||
for (var i = 0, l = this._owners && this._owners.length; i < l; i++)
|
for (var i = 0, l = this._owners && this._owners.length; i < l; i++)
|
||||||
this._owners[i]._changed(Change.STYLE);
|
this._owners[i]._changed(Change.STYLE);
|
||||||
},
|
},
|
||||||
|
@ -328,6 +330,8 @@ var Color = this.Color = Base.extend(new function() {
|
||||||
/**
|
/**
|
||||||
* Called by PathStyle whenever this color stops being used to define an
|
* Called by PathStyle whenever this color stops being used to define an
|
||||||
* item's style.
|
* item's style.
|
||||||
|
* TODO: Should we remove owners that are not used anymore for good, e.g.
|
||||||
|
* in a Item#destroy() method?
|
||||||
*/
|
*/
|
||||||
_removeOwner: function(item) {
|
_removeOwner: function(item) {
|
||||||
var index = this._owners ? this._owners.indexOf(item) : -1;
|
var index = this._owners ? this._owners.indexOf(item) : -1;
|
||||||
|
|
Loading…
Reference in a new issue