From 60f9d868a6567740ffbb50f31a96a565b7aa7213 Mon Sep 17 00:00:00 2001 From: Samuel Asensi Date: Sat, 13 Oct 2018 15:33:21 +0200 Subject: [PATCH] Fix Path#arcTo() do not pass by through point (#1543) Closes #1477 --- src/path/Path.js | 2 +- test/tests/Path.js | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/path/Path.js b/src/path/Path.js index 451300f1..7bda104f 100644 --- a/src/path/Path.js +++ b/src/path/Path.js @@ -2546,7 +2546,7 @@ new function() { // PostScript-style drawing commands } vector = from.subtract(center); extent = vector.getDirectedAngle(to.subtract(center)); - var centerSide = line.getSide(center); + var centerSide = line.getSide(center, true); if (centerSide === 0) { // If the center is lying on the line, we might have gotten // the wrong sign for extent above. Use the sign of the side diff --git a/test/tests/Path.js b/test/tests/Path.js index d5b8e812..7b268c2c 100644 --- a/test/tests/Path.js +++ b/test/tests/Path.js @@ -628,3 +628,13 @@ test('Path#add() with a lot of segments (#1493)', function() { path.clone(); expect(0); }); + +test('Path#arcTo(through, to) is on through point side (#1477)', function() { + var p1 = new Point(16, 21.5); + var p2 = new Point(22.5, 15); + var p3 = new Point(16.000000000000004, 8.5); + var path = new Path(); + path.add(p1); + path.arcTo(p2, p3); + equals(true, path.segments[1].point.x > p1.x); +});