mirror of
https://github.com/Hopiu/fabric.js.git
synced 2026-03-16 22:10:32 +00:00
Merge pull request #2204 from asturur/fixtextstylec
Add a bool to force cache clear on next render
This commit is contained in:
commit
37720eaeab
4 changed files with 7 additions and 4 deletions
|
|
@ -582,7 +582,7 @@
|
|||
}
|
||||
this.styles[lineIndex + 1] = newLineStyles;
|
||||
}
|
||||
this._clearCache();
|
||||
this._forceClearCache = true;
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
@ -612,7 +612,7 @@
|
|||
|
||||
this.styles[lineIndex][charIndex] =
|
||||
style || clone(currentLineStyles[charIndex - 1]);
|
||||
this._clearCache();
|
||||
this._forceClearCache = true;
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -579,7 +579,6 @@ fabric.util.object.extend(fabric.IText.prototype, /** @lends fabric.IText.protot
|
|||
|
||||
this._removeExtraneousStyles();
|
||||
|
||||
this._clearCache();
|
||||
this.canvas && this.canvas.renderAll();
|
||||
|
||||
this.setCoords();
|
||||
|
|
|
|||
|
|
@ -283,7 +283,7 @@
|
|||
}
|
||||
}
|
||||
/* not included in _extendStyles to avoid clearing cache more than once */
|
||||
this._clearCache();
|
||||
this._forceClearCache = true;
|
||||
return this;
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -682,6 +682,10 @@
|
|||
*/
|
||||
_shouldClearCache: function() {
|
||||
var shouldClear = false;
|
||||
if (this._forceClearCache) {
|
||||
this._forceClearCache = false;
|
||||
return true;
|
||||
}
|
||||
for (var prop in this._dimensionAffectingProps) {
|
||||
if (this['__' + prop] !== this[prop]) {
|
||||
this['__' + prop] = this[prop];
|
||||
|
|
|
|||
Loading…
Reference in a new issue