Skip to content

Commit

Permalink
Zero length arc winding fix
Browse files Browse the repository at this point in the history
  • Loading branch information
pissang committed Jan 13, 2016
1 parent b675dba commit ad46a25
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/contain/path.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,11 @@ define(function (require) {
roots[0] = -tmp;
roots[1] = tmp;

if (Math.abs(startAngle - endAngle) % PI2 < 1e-4) {
var diff = Math.abs(startAngle - endAngle);
if (diff < 1e-4) {
return 0;
}
if (diff % PI2 < 1e-4) {
// Is a circle
startAngle = 0;
endAngle = PI2;
Expand Down
5 changes: 4 additions & 1 deletion src/core/bbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,10 @@ define(function (require) {
var vec2Min = vec2.min;
var vec2Max = vec2.max;

if (Math.abs(startAngle - endAngle) % PI2 < 1e-4) {
var diff = Math.abs(startAngle - endAngle);


if (diff % PI2 < 1e-4 && diff > 1e-4) {
// Is a circle
min[0] = x - rx;
min[1] = y - ry;
Expand Down

0 comments on commit ad46a25

Please sign in to comment.