diff --git a/dist/fabric.js b/dist/fabric.js index db06e928..6734526c 100644 --- a/dist/fabric.js +++ b/dist/fabric.js @@ -12108,7 +12108,7 @@ fabric.util.object.extend(fabric.StaticCanvas.prototype, /** @lends fabric.Stati * default to false * since 1.7.0 * @type Boolean - * @default + * @default false */ statefullCache: false, @@ -12119,10 +12119,17 @@ fabric.util.object.extend(fabric.StaticCanvas.prototype, /** @lends fabric.Stati * default to false * since 1.7.0 * @type Boolean - * @default + * @default true */ noScaleCache: true, + /** + * When set to `true`, object's cache will be rerendered next render call. + * @type Boolean + * @default false + */ + dirty: false, + /** * List of properties to consider when checking if state * of an object is changed (fabric.Object#hasStateChanged) @@ -25508,6 +25515,12 @@ fabric.util.object.extend(fabric.IText.prototype, /** @lends fabric.IText.protot */ lockScalingFlip: true, + /** + * Override standard Object class values + * Textbox needs this on false + */ + noScaleCache: false, + /** * Constructor. Some scaling related property values are forced. Visibility * of controls is also fixed; only the rotation and width controls are @@ -25547,7 +25560,7 @@ fabric.util.object.extend(fabric.IText.prototype, /** @lends fabric.IText.protot this.dynamicMinWidth = 0; // wrap lines - this._textLines = this._splitTextIntoLines(); + this._textLines = this._splitTextIntoLines(ctx); // if after wrapping, the width is smaller than dynamicMinWidth, change the width and re-wrap if (this.dynamicMinWidth > this.width) { this._set('width', this.dynamicMinWidth); @@ -25771,14 +25784,14 @@ fabric.util.object.extend(fabric.IText.prototype, /** @lends fabric.IText.protot * @returns {Array} Array of lines in the Textbox. * @override */ - _splitTextIntoLines: function() { + _splitTextIntoLines: function(ctx) { var originalAlign = this.textAlign; - this.ctx.save(); - this._setTextStyles(this.ctx); + ctx.save(); + this._setTextStyles(ctx); this.textAlign = 'left'; - var lines = this._wrapText(this.ctx, this.text); + var lines = this._wrapText(ctx, this.text); this.textAlign = originalAlign; - this.ctx.restore(); + ctx.restore(); this._textLines = lines; this._styleMap = this._generateStyleMap(); return lines; diff --git a/dist/fabric.min.js b/dist/fabric.min.js index f76c2bd5..0295c0ed 100644 --- a/dist/fabric.min.js +++ b/dist/fabric.min.js @@ -1,8 +1,8 @@ var fabric=fabric||{version:"1.7.0"};"undefined"!=typeof exports&&(exports.fabric=fabric),"undefined"!=typeof document&&"undefined"!=typeof window?(fabric.document=document,fabric.window=window,window.fabric=fabric):(fabric.document=require("jsdom").jsdom("
"),fabric.document.createWindow?fabric.window=fabric.document.createWindow():fabric.window=fabric.document.parentWindow),fabric.isTouchSupported="ontouchstart"in fabric.document.documentElement,fabric.isLikelyNode="undefined"!=typeof Buffer&&"undefined"==typeof window,fabric.SHARED_ATTRIBUTES=["display","transform","fill","fill-opacity","fill-rule","opacity","stroke","stroke-dasharray","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","id"],fabric.DPI=96,fabric.reNum="(?:[-+]?(?:\\d+|\\d*\\.\\d+)(?:e[-+]?\\d+)?)",fabric.fontPaths={},fabric.charWidthsCache={},fabric.devicePixelRatio=fabric.window.devicePixelRatio||fabric.window.webkitDevicePixelRatio||fabric.window.mozDevicePixelRatio||1,function(){function t(t,e){if(this.__eventListeners[t]){var i=this.__eventListeners[t];e?i[i.indexOf(e)]=!1:fabric.util.array.fill(i,!1)}}function e(t,e){if(this.__eventListeners||(this.__eventListeners={}),1===arguments.length)for(var i in t)this.on(i,t[i]);else this.__eventListeners[t]||(this.__eventListeners[t]=[]),this.__eventListeners[t].push(e);return this}function i(e,i){if(this.__eventListeners){if(0===arguments.length)for(e in this.__eventListeners)t.call(this,e);else if(1===arguments.length&&"object"==typeof arguments[0])for(var r in e)t.call(this,r,e[r]);else t.call(this,e,i);return this}}function r(t,e){if(this.__eventListeners){var i=this.__eventListeners[t];if(i){for(var r=0,n=i.length;r