Skip to content

Commit

Permalink
Fix incorrect prev arc segment angle calculation.
Browse files Browse the repository at this point in the history
Close #1109
  • Loading branch information
GreLI committed Jul 14, 2019
1 parent 27cdeb7 commit 8671c4c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 3 additions & 2 deletions plugins/convertPathData.js
Expand Up @@ -335,12 +335,13 @@ function filters(path, params) {
arc.data[5] = arc.coords[0] - arc.base[0];
arc.data[6] = arc.coords[1] - arc.base[1];
var prevData = prev.instruction == 'a' ? prev.sdata : prev.data;
angle += findArcAngle(prevData,
var prevAngle = findArcAngle(prevData,
{
center: [prevData[4] + relCenter[0], prevData[5] + relCenter[1]],
center: [prevData[4] + circle.center[0], prevData[5] + circle.center[1]],
radius: circle.radius
}
);
angle += prevAngle;
if (angle > Math.PI) arc.data[3] = 1;
hasPrev = 1;
}
Expand Down
2 changes: 2 additions & 0 deletions test/plugins/convertPathData.14.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 8671c4c

Please sign in to comment.