From 08b9dcecb84943a9d6b49012f695dd7533f00215 Mon Sep 17 00:00:00 2001 From: sapics Date: Mon, 10 Apr 2017 12:17:56 +0900 Subject: [PATCH 1/2] Fix Path.Constructors.js initialization --- src/path/Path.Constructors.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/path/Path.Constructors.js b/src/path/Path.Constructors.js index c2d4fb3a..2098639d 100644 --- a/src/path/Path.Constructors.js +++ b/src/path/Path.Constructors.js @@ -28,7 +28,7 @@ Path.inject({ statics: new function() { path._closed = closed; // Set named arguments at the end, since some depend on geometry to be // defined (e.g. #clockwise) - return path.set(props); + return path.set(props, {insert: true}); } function createEllipse(center, radius, args) { From 018cb6285a3038cd0f2073ad8749561c3af5a7ee Mon Sep 17 00:00:00 2001 From: sapics Date: Mon, 10 Apr 2017 13:08:35 +0900 Subject: [PATCH 2/2] Add test for Path.Constructors initialization --- test/tests/Path_Constructors.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/tests/Path_Constructors.js b/test/tests/Path_Constructors.js index f0324b5e..e355b12f 100644 --- a/test/tests/Path_Constructors.js +++ b/test/tests/Path_Constructors.js @@ -130,3 +130,8 @@ test('new Path.Line({ from: from, to: to })', function() { }); equals(path.segments.toString(), '{ point: { x: 20, y: 20 } },{ point: { x: 40, y: 40 } }'); }); + +test('new Path.Line({insert: false, from:[50, 50], to:[100, 100]})', function() { + var path = new Path.Line({insert: false, from:[50, 50], to:[100, 100]}); + equals(path.insert === false, false); +});