mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-20 22:39:50 -05:00
Reformat code a bit.
This commit is contained in:
parent
3fa810a557
commit
ea3cc63e2e
1 changed files with 7 additions and 4 deletions
|
@ -622,12 +622,15 @@ statics: {
|
|||
var txs = [],
|
||||
tys = [],
|
||||
sx = Curve.solveCubic(v, 0, x, txs, 0, 1),
|
||||
sy = sx === 0 ? null : Curve.solveCubic(v, 1, y, tys, 0, 1),
|
||||
// Only solve for y if x actually has some solutions
|
||||
sy = sx !== 0 ? Curve.solveCubic(v, 1, y, tys, 0, 1) : 0,
|
||||
tx, ty;
|
||||
// sx, sy === -1 means infinite solutions.
|
||||
// sx === -1 && sy === -1 means the curve is a point and there is
|
||||
// an infinite number of solutions.
|
||||
if (sx === -1 && sy === -1) return 0;
|
||||
// sx === -1 && sy === -1 means the curve is a point and there really is
|
||||
// an infinite number of solutions. Let's just return t = 0, as they are
|
||||
// all valid and actually end up being the same position.
|
||||
if (sx === -1 && sy === -1)
|
||||
return 0;
|
||||
// Loop through all solutions for x and match with solutions for y,
|
||||
// to see if we either have a matching pair, or infinite solutions
|
||||
// for one or the other.
|
||||
|
|
Loading…
Reference in a new issue