From 5a82066aa92d5beb0c0b221d2f48781a3e0f1d25 Mon Sep 17 00:00:00 2001 From: Asturur <andreabogazzi79@gmail.com> Date: Wed, 28 Dec 2016 11:28:33 +0100 Subject: [PATCH] save new state anyway --- src/mixins/itext_key_behavior.mixin.js | 1 + src/shapes/text.class.js | 9 ++------- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/mixins/itext_key_behavior.mixin.js b/src/mixins/itext_key_behavior.mixin.js index b0d9d43070e..a475b5213e7 100644 --- a/src/mixins/itext_key_behavior.mixin.js +++ b/src/mixins/itext_key_behavior.mixin.js @@ -616,6 +616,7 @@ fabric.util.object.extend(fabric.IText.prototype, /** @lends fabric.IText.protot this._removeCharsFromTo(this.selectionStart, this.selectionEnd); } + this.set('dirty', true); this.setSelectionEnd(this.selectionStart); this._removeExtraneousStyles(); diff --git a/src/shapes/text.class.js b/src/shapes/text.class.js index 275ff5535d4..b48eb6bbc2b 100644 --- a/src/shapes/text.class.js +++ b/src/shapes/text.class.js @@ -713,13 +713,8 @@ * @private */ _shouldClearDimensionCache: function() { - var shouldClear = false; - if (this._forceClearCache) { - this._forceClearCache = false; - this.dirty = true; - return true; - } - shouldClear = this.hasStateChanged('_dimensionAffectingProps'); + var shouldClear = this._forceClearCache; + shouldClear || (shouldClear = this.hasStateChanged('_dimensionAffectingProps')); if (shouldClear) { this.saveState({ propertySet: '_dimensionAffectingProps' }); this.dirty = true;