mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-03 19:45:44 -05:00
Remove same value solution in solveCubic
This commit is contained in:
parent
ab24f92373
commit
bb683c9291
1 changed files with 2 additions and 2 deletions
|
@ -356,8 +356,8 @@ var Numerical = new function() {
|
|||
}
|
||||
// The cubic has been deflated to a quadratic.
|
||||
var count = Numerical.solveQuadratic(a, b1, c2, roots, min, max);
|
||||
if (isFinite(x) && count >= 0
|
||||
&& (count === 0 || x !== roots[count - 1])
|
||||
if (isFinite(x) && (count === 0
|
||||
|| count > 0 && x !== roots[0] && x !== roots[1])
|
||||
&& (min == null || x > min - EPSILON && x < max + EPSILON))
|
||||
roots[count++] = min == null ? x : clamp(x, min, max);
|
||||
return count;
|
||||
|
|
Loading…
Reference in a new issue