From f3e7723b40d5ada7d9665b61b4b0b7f82da9ae81 Mon Sep 17 00:00:00 2001 From: Asturur Date: Sat, 10 Feb 2018 11:45:26 +0100 Subject: [PATCH 1/4] fix Jsdoc --- src/mixins/object_geometry.mixin.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mixins/object_geometry.mixin.js b/src/mixins/object_geometry.mixin.js index 867ff6ed7f8..2a35a5d93f4 100644 --- a/src/mixins/object_geometry.mixin.js +++ b/src/mixins/object_geometry.mixin.js @@ -266,7 +266,7 @@ * Returns coordinates of object's bounding rectangle (left, top, width, height) * the box is intented as aligned to axis of canvas. * @param {Boolean} [absolute] use coordinates without viewportTransform - * @param {Boolean} [calculate] use coordinates of current position instead of .oCoords + * @param {Boolean} [calculate] use coordinates of current position instead of .oCoords / .aCoords * @return {Object} Object with left, top, width, height properties */ getBoundingRect: function(absolute, calculate) { From bdd229180fca862b88f9e988afaff57b3dafb1d7 Mon Sep 17 00:00:00 2001 From: Asturur Date: Sat, 10 Feb 2018 11:55:28 +0100 Subject: [PATCH 2/4] done --- src/mixins/object_geometry.mixin.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mixins/object_geometry.mixin.js b/src/mixins/object_geometry.mixin.js index 2a35a5d93f4..3a197baa467 100644 --- a/src/mixins/object_geometry.mixin.js +++ b/src/mixins/object_geometry.mixin.js @@ -453,7 +453,7 @@ 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.skewX + sep + this.skewY + sep + this.angle + sep + this.originX + sep + this.orignY + sep + this.width + sep + this.height + sep + this.strokeWidth + this.flipX + this.flipY; }, From 56663f5ba5796940076151f69895b845d1413cde Mon Sep 17 00:00:00 2001 From: Asturur Date: Sat, 10 Feb 2018 11:59:21 +0100 Subject: [PATCH 3/4] added test --- test/unit/object_geometry.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/test/unit/object_geometry.js b/test/unit/object_geometry.js index 21b1cd43e2e..70efc2438d5 100644 --- a/test/unit/object_geometry.js +++ b/test/unit/object_geometry.js @@ -348,6 +348,19 @@ assert.notEqual(key4, key3, 'keys are different'); }); + QUnit.test('transformMatrixKey depends from originX/originY', function(assert) { + var cObj = new fabric.Object( + { left: -10, top: -10, width: 30, height: 40, strokeWidth: 0, originX: 'left', originY: 'top' }); + var key1 = cObj.transformMatrixKey(); + cObj.originX = 'center'; + var key2 = cObj.transformMatrixKey(); + cObj.originY = 'center'; + var key3 = cObj.transformMatrixKey(); + assert.notEqual(key1, key2, 'keys are different origins 1'); + assert.notEqual(key1, key3, 'keys are different origins 2'); + assert.notEqual(key2, key3, 'keys are different origins 3'); + }); + QUnit.test('isOnScreen with object that include canvas', function(assert) { var cObj = new fabric.Object( { left: -10, top: -10, width: canvas.getWidth() + 100, height: canvas.getHeight(), strokeWidth: 0}); From ca095739b30c3cb5a9ed92c1349601dc044ff4c9 Mon Sep 17 00:00:00 2001 From: Asturur Date: Sat, 10 Feb 2018 12:00:59 +0100 Subject: [PATCH 4/4] fixed the typo --- src/mixins/object_geometry.mixin.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mixins/object_geometry.mixin.js b/src/mixins/object_geometry.mixin.js index 3a197baa467..bb9b9d7814f 100644 --- a/src/mixins/object_geometry.mixin.js +++ b/src/mixins/object_geometry.mixin.js @@ -453,7 +453,7 @@ 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.originX + sep + this.orignY + + sep + this.skewX + sep + this.skewY + sep + this.angle + sep + this.originX + sep + this.originY + sep + this.width + sep + this.height + sep + this.strokeWidth + this.flipX + this.flipY; },