From c8da9fbfc347314b5b6da2017170f97d9af682df Mon Sep 17 00:00:00 2001 From: GordoRank Date: Thu, 23 Jan 2014 10:07:33 +0000 Subject: [PATCH] update cache automatically in _set() --- src/shapes/object.class.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/shapes/object.class.js b/src/shapes/object.class.js index 20a8d42a..adfe4721 100644 --- a/src/shapes/object.class.js +++ b/src/shapes/object.class.js @@ -884,6 +884,24 @@ } this[key] = value; + + if (this.canvas && this.canvas.turbo) { + if (key !== 'left' && + key !== 'top' && + key !== 'scaleX' && + key !== 'scaleY' && + key !== 'width' && + key !== 'height' && + key !== 'angle' || + !this.active){ + + if (this.canvas._isCacheable(this)) { + this.width = this.getWidth(); + this.height = this.getHeight(); + } + this.updateCache(); + } + } return this; },