mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-01 10:48:38 -05:00
Nullify cssString cache when color/alpha values change.
This commit is contained in:
parent
8d570d0834
commit
57b7b364bc
3 changed files with 3 additions and 0 deletions
|
@ -14,6 +14,7 @@ Color = Base.extend({
|
||||||
else if (this._alpha < 0) this._alpha = 0;
|
else if (this._alpha < 0) this._alpha = 0;
|
||||||
else if (alpha > 1) this._alpha = 1;
|
else if (alpha > 1) this._alpha = 1;
|
||||||
else this._alpha = alpha;
|
else this._alpha = alpha;
|
||||||
|
this._cssString = null;
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -82,6 +82,7 @@ GrayColor = Color.extend({
|
||||||
return 1 - this._gray;
|
return 1 - this._gray;
|
||||||
};
|
};
|
||||||
fields['set' + key.capitalize()] = function(value) {
|
fields['set' + key.capitalize()] = function(value) {
|
||||||
|
this._cssString = null;
|
||||||
this._gray = this._gray * (1 - weight) + weight * (1 - value);
|
this._gray = this._gray * (1 - weight) + weight * (1 - value);
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
|
@ -156,6 +156,7 @@ RGBColor = Color.extend(new function() {
|
||||||
},
|
},
|
||||||
|
|
||||||
setGray: function(gray) {
|
setGray: function(gray) {
|
||||||
|
this._cssString = null;
|
||||||
this._red = this._green = this._blue = gray;
|
this._red = this._green = this._blue = gray;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue