From 8573c755b69e8618ec635fe8b483da5f5b9e5fe2 Mon Sep 17 00:00:00 2001 From: Andrea Bogazzi Date: Sat, 18 Jul 2015 00:50:56 +0200 Subject: [PATCH 1/2] Update object.class.js --- src/shapes/object.class.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/shapes/object.class.js b/src/shapes/object.class.js index a1d4d98ffad..5b4c943875b 100644 --- a/src/shapes/object.class.js +++ b/src/shapes/object.class.js @@ -797,7 +797,8 @@ clipTo: this.clipTo && String(this.clipTo), backgroundColor: this.backgroundColor, fillRule: this.fillRule, - globalCompositeOperation: this.globalCompositeOperation + globalCompositeOperation: this.globalCompositeOperation, + transformMatrix: this.transformMatrix }; if (!this.includeDefaultValues) { From f805e572977ca788f5b3b4856a2168bf2be64569 Mon Sep 17 00:00:00 2001 From: Andrea Bogazzi Date: Mon, 20 Jul 2015 01:28:38 +0200 Subject: [PATCH 2/2] Update rect.js --- test/unit/canvas.js | 4 ++-- test/unit/canvas_static.js | 9 +++++---- test/unit/circle.js | 3 ++- test/unit/ellipse.js | 3 ++- test/unit/group.js | 1 + test/unit/image.js | 1 + test/unit/itext.js | 1 + test/unit/line.js | 3 ++- test/unit/object.js | 12 ++++++++---- test/unit/path.js | 3 ++- test/unit/path_group.js | 1 + test/unit/polygon.js | 6 ++++-- test/unit/polyline.js | 6 ++++-- test/unit/rect.js | 1 + test/unit/text.js | 5 +++-- 15 files changed, 39 insertions(+), 20 deletions(-) diff --git a/test/unit/canvas.js b/test/unit/canvas.js index 5bdcd2eccd2..44a6c325885 100644 --- a/test/unit/canvas.js +++ b/test/unit/canvas.js @@ -41,12 +41,12 @@ var PATH_DATALESS_JSON = '{"objects":[{"type":"path","originX":"left","originY":"top","left":100,"top":100,"width":200,"height":200,"fill":"rgb(0,0,0)",'+ '"stroke":null,"strokeWidth":1,"strokeDashArray":null,"strokeLineCap":"butt","strokeLineJoin":"miter","strokeMiterLimit":10,'+ '"scaleX":1,"scaleY":1,"angle":0,"flipX":false,"flipY":false,"opacity":1,'+ - '"shadow":null,"visible":true,"clipTo":null,"backgroundColor":"","fillRule":"nonzero","globalCompositeOperation":"source-over","path":"http://example.com/","pathOffset":{"x":200,"y":200}}],"background":""}'; + '"shadow":null,"visible":true,"clipTo":null,"backgroundColor":"","fillRule":"nonzero","globalCompositeOperation":"source-over","transformMatrix":null,"path":"http://example.com/","pathOffset":{"x":200,"y":200}}],"background":""}'; var RECT_JSON = '{"objects":[{"type":"rect","originX":"left","originY":"top","left":0,"top":0,"width":10,"height":10,"fill":"rgb(0,0,0)",'+ '"stroke":null,"strokeWidth":1,"strokeDashArray":null,"strokeLineCap":"butt","strokeLineJoin":"miter","strokeMiterLimit":10,"scaleX":1,"scaleY":1,"angle":0,"flipX":false,"flipY":false,"opacity":1,'+ '"shadow":null,'+ - '"visible":true,"clipTo":null,"backgroundColor":"","fillRule":"nonzero","globalCompositeOperation":"source-over","rx":0,"ry":0}],"background":"#ff5555","overlay":"rgba(0,0,0,0.2)"}'; + '"visible":true,"clipTo":null,"backgroundColor":"","fillRule":"nonzero","globalCompositeOperation":"source-over","transformMatrix":null,"rx":0,"ry":0}],"background":"#ff5555","overlay":"rgba(0,0,0,0.2)"}'; var el = fabric.document.createElement('canvas'); el.width = 600; el.height = 600; diff --git a/test/unit/canvas_static.js b/test/unit/canvas_static.js index f5be0db2154..d639969045e 100644 --- a/test/unit/canvas_static.js +++ b/test/unit/canvas_static.js @@ -28,17 +28,17 @@ var PATH_DATALESS_JSON = '{"objects":[{"type":"path","originX":"left","originY":"top","left":100,"top":100,"width":200,"height":200,"fill":"rgb(0,0,0)",'+ '"stroke":null,"strokeWidth":1,"strokeDashArray":null,"strokeLineCap":"butt","strokeLineJoin":"miter","strokeMiterLimit":10,'+ '"scaleX":1,"scaleY":1,"angle":0,"flipX":false,"flipY":false,"opacity":1,'+ - '"shadow":null,"visible":true,"clipTo":null,"backgroundColor":"","fillRule":"nonzero","globalCompositeOperation":"source-over","path":"http://example.com/","pathOffset":{"x":200,"y":200}}],"background":""}'; + '"shadow":null,"visible":true,"clipTo":null,"backgroundColor":"","fillRule":"nonzero","globalCompositeOperation":"source-over","transformMatrix":null,"path":"http://example.com/","pathOffset":{"x":200,"y":200}}],"background":""}'; var RECT_JSON = '{"objects":[{"type":"rect","originX":"left","originY":"top","left":0,"top":0,"width":10,"height":10,"fill":"rgb(0,0,0)",'+ '"stroke":null,"strokeWidth":1,"strokeDashArray":null,"strokeLineCap":"butt","strokeLineJoin":"miter","strokeMiterLimit":10,'+ '"scaleX":1,"scaleY":1,"angle":0,"flipX":false,"flipY":false,"opacity":1,'+ - '"shadow":null,"visible":true,"clipTo":null,"backgroundColor":"","fillRule":"nonzero","globalCompositeOperation":"source-over","rx":0,"ry":0}],"background":"#ff5555","overlay":"rgba(0,0,0,0.2)"}'; + '"shadow":null,"visible":true,"clipTo":null,"backgroundColor":"","fillRule":"nonzero","globalCompositeOperation":"source-over","transformMatrix":null,"rx":0,"ry":0}],"background":"#ff5555","overlay":"rgba(0,0,0,0.2)"}'; var RECT_JSON_WITH_PADDING = '{"objects":[{"type":"rect","originX":"left","originY":"top","left":0,"top":0,"width":10,"height":20,"fill":"rgb(0,0,0)",'+ '"stroke":null,"strokeWidth":1,"strokeDashArray":null,"strokeLineCap":"butt","strokeLineJoin":"miter","strokeMiterLimit":10,'+ '"scaleX":1,"scaleY":1,"angle":0,"flipX":false,"flipY":false,"opacity":1,'+ - '"shadow":null,"visible":true,"clipTo":null,"backgroundColor":"","fillRule":"nonzero","globalCompositeOperation":"source-over","padding":123,"foo":"bar","rx":0,"ry":0}],"background":""}'; + '"shadow":null,"visible":true,"clipTo":null,"backgroundColor":"","fillRule":"nonzero","globalCompositeOperation":"source-over","transformMatrix":null,"padding":123,"foo":"bar","rx":0,"ry":0}],"background":""}'; function getAbsolutePath(path) { var isAbsolute = /^https?:/.test(path); @@ -82,7 +82,8 @@ 'clipTo': null, 'filters': [], 'fillRule': 'nonzero', - 'globalCompositeOperation': 'source-over' + 'globalCompositeOperation': 'source-over', + 'transformMatrix': null }; function _createImageElement() { diff --git a/test/unit/circle.js b/test/unit/circle.js index 33ecfc45ae3..a2dc5d09a70 100644 --- a/test/unit/circle.js +++ b/test/unit/circle.js @@ -107,7 +107,8 @@ 'globalCompositeOperation': 'source-over', 'radius': 0, 'startAngle': 0, - 'endAngle': 2 * Math.PI + 'endAngle': 2 * Math.PI, + 'transformMatrix': null }; ok(typeof circle.toObject == 'function'); deepEqual(circle.toObject(), defaultProperties); diff --git a/test/unit/ellipse.js b/test/unit/ellipse.js index 89dc01aecf0..fc9fd388b08 100644 --- a/test/unit/ellipse.js +++ b/test/unit/ellipse.js @@ -49,7 +49,8 @@ 'backgroundColor': '', 'fillRule': 'nonzero', 'globalCompositeOperation': 'source-over', - 'clipTo': null + 'clipTo': null, + 'transformMatrix': null }; ok(typeof ellipse.toObject == 'function'); deepEqual(ellipse.toObject(), defaultProperties); diff --git a/test/unit/group.js b/test/unit/group.js index 9a95c8bd1eb..96ab19bd033 100644 --- a/test/unit/group.js +++ b/test/unit/group.js @@ -190,6 +190,7 @@ 'opacity': 1, 'fillRule': 'nonzero', 'globalCompositeOperation': 'source-over', + 'transformMatrix': null, 'objects': clone.objects }; diff --git a/test/unit/image.js b/test/unit/image.js index 9a66a8bbc88..70375a15f44 100644 --- a/test/unit/image.js +++ b/test/unit/image.js @@ -43,6 +43,7 @@ 'filters': [], 'fillRule': 'nonzero', 'globalCompositeOperation': 'source-over', + 'transformMatrix': null }; function _createImageElement() { diff --git a/test/unit/itext.js b/test/unit/itext.js index 9d7963de34b..9a7faebdbae 100644 --- a/test/unit/itext.js +++ b/test/unit/itext.js @@ -43,6 +43,7 @@ 'textBackgroundColor': '', 'fillRule': 'nonzero', 'globalCompositeOperation': 'source-over', + 'transformMatrix': null, styles: { } }; diff --git a/test/unit/line.js b/test/unit/line.js index d7e56cf0223..47aae9aa16b 100644 --- a/test/unit/line.js +++ b/test/unit/line.js @@ -30,7 +30,8 @@ 'clipTo': null, 'backgroundColor': '', 'fillRule': 'nonzero', - 'globalCompositeOperation': 'source-over' + 'globalCompositeOperation': 'source-over', + 'transformMatrix': null }; QUnit.module('fabric.Line'); diff --git a/test/unit/object.js b/test/unit/object.js index 04b8925fc88..ec7cfe2021a 100644 --- a/test/unit/object.js +++ b/test/unit/object.js @@ -153,12 +153,14 @@ var emptyObjectJSON = '{"type":"object","originX":"left","originY":"top","left":0,"top":0,"width":0,"height":0,"fill":"rgb(0,0,0)",'+ '"stroke":null,"strokeWidth":1,"strokeDashArray":null,"strokeLineCap":"butt","strokeLineJoin":"miter","strokeMiterLimit":10,'+ '"scaleX":1,"scaleY":1,"angle":0,"flipX":false,"flipY":false,"opacity":1,'+ - '"shadow":null,"visible":true,"clipTo":null,"backgroundColor":"","fillRule":"nonzero","globalCompositeOperation":"source-over"}'; + '"shadow":null,"visible":true,"clipTo":null,"backgroundColor":"","fillRule":"nonzero","globalCompositeOperation":"source-over",'+ + '"transformMatrix":null}'; var augmentedJSON = '{"type":"object","originX":"left","originY":"top","left":0,"top":0,"width":122,"height":0,"fill":"rgb(0,0,0)",'+ '"stroke":null,"strokeWidth":1,"strokeDashArray":[5,2],"strokeLineCap":"round","strokeLineJoin":"bevil","strokeMiterLimit":5,'+ '"scaleX":1.3,"scaleY":1,"angle":0,"flipX":false,"flipY":true,"opacity":0.88,'+ - '"shadow":null,"visible":true,"clipTo":null,"backgroundColor":"","fillRule":"nonzero","globalCompositeOperation":"source-over"}'; + '"shadow":null,"visible":true,"clipTo":null,"backgroundColor":"","fillRule":"nonzero","globalCompositeOperation":"source-over",'+ + '"transformMatrix":null}'; var cObj = new fabric.Object(); ok(typeof cObj.toJSON == 'function'); @@ -203,7 +205,8 @@ 'backgroundColor': '', 'clipTo': null, 'fillRule': 'nonzero', - 'globalCompositeOperation': 'source-over' + 'globalCompositeOperation': 'source-over', + 'transformMatrix': null }; var augmentedObjectRepr = { @@ -232,7 +235,8 @@ 'backgroundColor': '', 'clipTo': null, 'fillRule': 'nonzero', - 'globalCompositeOperation': 'source-over' + 'globalCompositeOperation': 'source-over', + 'transformMatrix': null }; var cObj = new fabric.Object(); diff --git a/test/unit/path.js b/test/unit/path.js index 5f6a50d5c34..5e0ce502abc 100644 --- a/test/unit/path.js +++ b/test/unit/path.js @@ -28,7 +28,8 @@ 'backgroundColor': '', 'clipTo': null, 'fillRule': 'nonzero', - 'globalCompositeOperation': 'source-over' + 'globalCompositeOperation': 'source-over', + 'transformMatrix': null }; function getPathElement(path) { diff --git a/test/unit/path_group.js b/test/unit/path_group.js index eef8178afaf..75203cacac3 100644 --- a/test/unit/path_group.js +++ b/test/unit/path_group.js @@ -27,6 +27,7 @@ 'backgroundColor': '', 'fillRule': 'nonzero', 'globalCompositeOperation': 'source-over', + 'transformMatrix': null, 'paths': getPathObjects() }; diff --git a/test/unit/polygon.js b/test/unit/polygon.js index 367a28646d0..fb59c36b596 100644 --- a/test/unit/polygon.js +++ b/test/unit/polygon.js @@ -34,7 +34,8 @@ 'backgroundColor': '', 'clipTo': null, 'fillRule': 'nonzero', - 'globalCompositeOperation': 'source-over' + 'globalCompositeOperation': 'source-over', + 'transformMatrix': null }; var REFERENCE_EMPTY_OBJECT = { @@ -145,7 +146,8 @@ 'opacity': 0.34, 'points': expectedPoints, 'top': 10, - 'left': 10 + 'left': 10, + 'transformMatrix': [ 2, 0, 0, 2, -10, -20 ] })); deepEqual(polygonWithAttrs.get('transformMatrix'), [ 2, 0, 0, 2, -10, -20 ]); diff --git a/test/unit/polyline.js b/test/unit/polyline.js index 4726d695101..6e263efb793 100644 --- a/test/unit/polyline.js +++ b/test/unit/polyline.js @@ -34,7 +34,8 @@ 'backgroundColor': '', 'clipTo': null, 'fillRule': 'nonzero', - 'globalCompositeOperation': 'source-over' + 'globalCompositeOperation': 'source-over', + 'transformMatrix': null }; var REFERENCE_EMPTY_OBJECT = { @@ -133,7 +134,8 @@ 'opacity': 0.34, 'points': expectedPoints, 'left': 10, - 'top': 10 + 'top': 10, + 'transformMatrix' : [ 2, 0, 0, 2, -10, -20 ] })); deepEqual(polylineWithAttrs.get('transformMatrix'), [ 2, 0, 0, 2, -10, -20 ]); diff --git a/test/unit/rect.js b/test/unit/rect.js index 58fd388f188..78c65e07672 100644 --- a/test/unit/rect.js +++ b/test/unit/rect.js @@ -27,6 +27,7 @@ 'clipTo': null, 'fillRule': 'nonzero', 'globalCompositeOperation': 'source-over', + 'transformMatrix': null, 'rx': 0, 'ry': 0, }; diff --git a/test/unit/text.js b/test/unit/text.js index 819180134cf..f93110998fc 100644 --- a/test/unit/text.js +++ b/test/unit/text.js @@ -42,8 +42,9 @@ 'textDecoration': '', 'textAlign': 'left', 'textBackgroundColor': '', - 'fillRule': 'nonzero', - 'globalCompositeOperation': 'source-over' + 'fillRule': 'nonzero', + 'globalCompositeOperation': 'source-over', + 'transformMatrix': null }; var TEXT_SVG = '\t\n\t\tx\n\t\n';