mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-05 20:32:00 -05:00
Check for denominator == 0 with tolerance.
This commit is contained in:
parent
0366752a6f
commit
10e1417dc2
1 changed files with 1 additions and 1 deletions
|
@ -196,7 +196,7 @@ var PathFitter = Base.extend({
|
|||
// Compute f(u)/f'(u)
|
||||
var V = Q_u.subtract(P),
|
||||
df = Q1_u.dot(Q1_u) + V.dot(Q2_u);
|
||||
if (df == 0)
|
||||
if (Math.abs(df) < Numerical.TOLERANCE)
|
||||
return u;
|
||||
// u = u - f(u) / f'(u)
|
||||
return u - V.dot(Q1_u) / df;
|
||||
|
|
Loading…
Reference in a new issue