Skip to content

Commit 9072fed

Browse files
committed
Canvg was miscalculating a path instruction
1 parent ac12a24 commit 9072fed

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

libs/canvg_context2d/canvg.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1774,6 +1774,15 @@
17741774
}
17751775
// initial angle
17761776
var a1 = a([1, 0], [(currp.x - cpp.x) / rx, (currp.y - cpp.y) / ry]);
1777+
1778+
//ss
1779+
//<path fill="#919191" d="M-78.57679247853098,37.66125568519824 A87.136,87.136 0 0,1 -78.57679247853098,37.66125568519824L0,0Z"></path>
1780+
// was causing an issue (s was ending up as Infinity
1781+
if (isNaN(a1) ){
1782+
continue;
1783+
}
1784+
//ss end
1785+
17771786
// angle delta
17781787
var u = [(currp.x - cpp.x) / rx, (currp.y - cpp.y) / ry];
17791788
var v = [(-currp.x - cpp.x) / rx, (-currp.y - cpp.y) / ry];
@@ -1790,7 +1799,7 @@
17901799
);
17911800
pp.addMarkerAngle(halfWay, ah - dir * Math.PI / 2);
17921801
pp.addMarkerAngle(cp, ah - dir * Math.PI);
1793-
1802+
17941803
bb.addPoint(cp.x, cp.y); // TODO: this is too naive, make it better
17951804
if (ctx != null) {
17961805
var r = rx > ry ? rx : ry;

0 commit comments

Comments
 (0)