From 57b7b364bc8820067fca5b4dab29bad85f3f90d8 Mon Sep 17 00:00:00 2001 From: Jonathan Puckey Date: Sat, 19 Feb 2011 18:01:08 +0100 Subject: [PATCH] Nullify cssString cache when color/alpha values change. --- src/color/Color.js | 1 + src/color/GrayColor.js | 1 + src/color/RGBColor.js | 1 + 3 files changed, 3 insertions(+) diff --git a/src/color/Color.js b/src/color/Color.js index bd9ca0df..1ecd6256 100644 --- a/src/color/Color.js +++ b/src/color/Color.js @@ -14,6 +14,7 @@ Color = Base.extend({ else if (this._alpha < 0) this._alpha = 0; else if (alpha > 1) this._alpha = 1; else this._alpha = alpha; + this._cssString = null; }, /** diff --git a/src/color/GrayColor.js b/src/color/GrayColor.js index dd6c5af1..ad54a2a7 100644 --- a/src/color/GrayColor.js +++ b/src/color/GrayColor.js @@ -82,6 +82,7 @@ GrayColor = Color.extend({ return 1 - this._gray; }; fields['set' + key.capitalize()] = function(value) { + this._cssString = null; this._gray = this._gray * (1 - weight) + weight * (1 - value); }; }); diff --git a/src/color/RGBColor.js b/src/color/RGBColor.js index 34f756f6..ff6ace2b 100644 --- a/src/color/RGBColor.js +++ b/src/color/RGBColor.js @@ -156,6 +156,7 @@ RGBColor = Color.extend(new function() { }, setGray: function(gray) { + this._cssString = null; this._red = this._green = this._blue = gray; },