Skip to content

Commit

Permalink
Fix normalize function to handle 0/0 (#2888)
Browse files Browse the repository at this point in the history
  • Loading branch information
asturur committed Apr 13, 2016
1 parent a5192e4 commit de4826f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/util/anim_ease.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,13 @@
s = p / 4;
}
else {
s = p / (2 * Math.PI) * Math.asin(c / a);
//handle the 0/0 case:
if (c === 0 && a === 0) {
s = p / (2 * Math.PI) * Math.asin(1);
}
else {
s = p / (2 * Math.PI) * Math.asin(c / a);
}
}
return { a: a, c: c, p: p, s: s };
}
Expand Down

0 comments on commit de4826f

Please sign in to comment.