From 1e3734ee5f06ed5ff3363cc2fe164090a0bccb2a Mon Sep 17 00:00:00 2001 From: Nicolas Morel Date: Wed, 4 Jul 2018 17:16:33 +0200 Subject: [PATCH 1/2] Fix Circle toSVG method adding an incorrect double quote --- src/shapes/circle.class.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shapes/circle.class.js b/src/shapes/circle.class.js index ab89ad6f8ae..6134f7d6194 100644 --- a/src/shapes/circle.class.js +++ b/src/shapes/circle.class.js @@ -114,7 +114,7 @@ '" transform="', this.getSvgTransform(), ' ', this.getSvgTransformMatrix(), '"', this.addPaintOrder(), - '"/>\n' + '/>\n' ); } From 2daabc3b50812add72d591628c889a114feac037 Mon Sep 17 00:00:00 2001 From: Nicolas Morel Date: Tue, 10 Jul 2018 17:27:24 +0200 Subject: [PATCH 2/2] Add tests for Circle.toSVG --- test/unit/circle.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/test/unit/circle.js b/test/unit/circle.js index a6b9e5932ba..73f5f0e5c9e 100644 --- a/test/unit/circle.js +++ b/test/unit/circle.js @@ -137,6 +137,20 @@ assert.deepEqual(circle.toObject(), augmentedProperties); }); + QUnit.test('toSVG with full circle', function(assert) { + var circle = new fabric.Circle({ width: 100, height: 100, radius: 10 }); + var svg = circle.toSVG(); + + assert.equal(svg, '\n'); + }); + + QUnit.test('toSVG with half circle', function(assert) { + var circle = new fabric.Circle({ width: 100, height: 100, radius: 10, endAngle: Math.PI }); + var svg = circle.toSVG(); + + assert.equal(svg, '\n'); + }); + QUnit.test('fromElement', function(assert) { assert.ok(typeof fabric.Circle.fromElement === 'function');