make cacheCanvas created on the fly if needed (#3706)

This commit is contained in:
Andrea Bogazzi 2017-02-16 17:19:32 -05:00 committed by GitHub
parent d058307dd0
commit ff0b6f0a50

View file

@ -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);