diff --git a/build/files/src/brushes/pencil_brush.class.js b/build/files/src/brushes/pencil_brush.class.js index 25a3b28b6d..2c87a46ccb 100644 --- a/build/files/src/brushes/pencil_brush.class.js +++ b/build/files/src/brushes/pencil_brush.class.js @@ -145,7 +145,7 @@ var path = [], i, width = this.width / 1000, p1 = new fabric.Point(points[0].x, points[0].y), p2 = new fabric.Point(points[1].x, points[1].y), - len = points.length, multSignX, multSignY, manyPoints = len > 2; + len = points.length, multSignX = 1, multSignY = 1, manyPoints = len > 2; if (manyPoints) { multSignX = points[2].x < p2.x ? -1 : points[2].x === p2.x ? 0 : 1; diff --git a/build/files/src/mixins/object_geometry.mixin.js b/build/files/src/mixins/object_geometry.mixin.js index 02bae161f3..9200597e0d 100644 --- a/build/files/src/mixins/object_geometry.mixin.js +++ b/build/files/src/mixins/object_geometry.mixin.js @@ -453,7 +453,8 @@ prefix = this.group.transformMatrixKey(skipGroup) + sep; }; return prefix + this.top + sep + this.left + sep + this.scaleX + sep + this.scaleY + - sep + this.skewX + sep + this.skewY + sep + this.angle + sep + this.flipX + sep + this.flipY; + sep + this.skewX + sep + this.skewY + sep + this.angle + sep + this.flipX + sep + this.flipY + + sep + this.width + sep + this.height; }, /** diff --git a/build/files/src/shapes/image.class.js b/build/files/src/shapes/image.class.js index e68439ab70..f3006b4d1d 100644 --- a/build/files/src/shapes/image.class.js +++ b/build/files/src/shapes/image.class.js @@ -13,12 +13,6 @@ return; } - var stateProperties = fabric.Object.prototype.stateProperties.concat(); - stateProperties.push( - 'cropX', - 'cropY' - ); - /** * Image class * @class fabric.Image @@ -95,7 +89,7 @@ * as well as for history (undo/redo) purposes * @type Array */ - stateProperties: stateProperties, + stateProperties: fabric.Object.prototype.stateProperties.concat('cropX', 'cropY'), /** * When `true`, object is cached on an additional canvas. diff --git a/lib/fabric.js b/lib/fabric.js index 3c10a68bc9..b7ba7021f2 100644 --- a/lib/fabric.js +++ b/lib/fabric.js @@ -8306,7 +8306,7 @@ fabric.BaseBrush = fabric.util.createClass(/** @lends fabric.BaseBrush.prototype var path = [], i, width = this.width / 1000, p1 = new fabric.Point(points[0].x, points[0].y), p2 = new fabric.Point(points[1].x, points[1].y), - len = points.length, multSignX, multSignY, manyPoints = len > 2; + len = points.length, multSignX = 1, multSignY = 1, manyPoints = len > 2; if (manyPoints) { multSignX = points[2].x < p2.x ? -1 : points[2].x === p2.x ? 0 : 1; @@ -14344,7 +14344,8 @@ fabric.util.object.extend(fabric.StaticCanvas.prototype, /** @lends fabric.Stati prefix = this.group.transformMatrixKey(skipGroup) + sep; }; return prefix + this.top + sep + this.left + sep + this.scaleX + sep + this.scaleY + - sep + this.skewX + sep + this.skewY + sep + this.angle + sep + this.flipX + sep + this.flipY; + sep + this.skewX + sep + this.skewY + sep + this.angle + sep + this.flipX + sep + this.flipY + + sep + this.width + sep + this.height; }, /** @@ -18659,12 +18660,6 @@ fabric.util.object.extend(fabric.Object.prototype, /** @lends fabric.Object.prot return; } - var stateProperties = fabric.Object.prototype.stateProperties.concat(); - stateProperties.push( - 'cropX', - 'cropY' - ); - /** * Image class * @class fabric.Image @@ -18741,7 +18736,7 @@ fabric.util.object.extend(fabric.Object.prototype, /** @lends fabric.Object.prot * as well as for history (undo/redo) purposes * @type Array */ - stateProperties: stateProperties, + stateProperties: fabric.Object.prototype.stateProperties.concat('cropX', 'cropY'), /** * When `true`, object is cached on an additional canvas.