From ff0b6f0a509789269d5143a975b0d8d29329925e Mon Sep 17 00:00:00 2001 From: Andrea Bogazzi Date: Thu, 16 Feb 2017 17:19:32 -0500 Subject: [PATCH] make cacheCanvas created on the fly if needed (#3706) --- src/shapes/object.class.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/shapes/object.class.js b/src/shapes/object.class.js index 3cee73ee..02d65d10 100644 --- a/src/shapes/object.class.js +++ b/src/shapes/object.class.js @@ -1148,6 +1148,9 @@ } this.clipTo && fabric.util.clipContext(this, ctx); if (this.objectCaching && (!this.group || this.needsItsOwnCache)) { + if (!this._cacheCanvas) { + this._createCacheCanvas(); + } if (this.isCacheDirty(noTransform)) { this.statefullCache && this.saveState({ propertySet: 'cacheProperties' }); this.drawObject(this._cacheContext, noTransform);