Skip to content

Commit

Permalink
Fixed regression due to angle calculation changes. Fixes svg#517
Browse files Browse the repository at this point in the history
  • Loading branch information
GreLI committed Mar 20, 2016
1 parent 619aaf8 commit 0f599b6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 7 additions & 1 deletion plugins/convertPathData.js
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,13 @@ function filters(path, params) {
arc.base = prev.base;
arc.data[5] = arc.coords[0] - arc.base[0];
arc.data[6] = arc.coords[1] - arc.base[1];
angle += findArcAngle(prev.instruction == 'a' ? prev.sdata : prev.data, relCircle);
var prevData = prev.instruction == 'a' ? prev.sdata : prev.data;
angle += findArcAngle(prevData,
{
center: [prevData[4] + relCenter[0], prevData[5] + relCenter[1]],
radius: circle.radius
}
);
if (angle > Math.PI) arc.data[3] = 1;
hasPrev = 1;
}
Expand Down
2 changes: 2 additions & 0 deletions test/plugins/convertPathData.14.svg
Loading
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 0f599b6

Please sign in to comment.