mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-05 20:32:00 -05:00
Some code clean-up.
This commit is contained in:
parent
6ea81e5651
commit
9977b6ab68
1 changed files with 7 additions and 9 deletions
|
@ -297,9 +297,8 @@ PathItem.inject(new function() {
|
||||||
values = curve.values,
|
values = curve.values,
|
||||||
winding = curve.winding,
|
winding = curve.winding,
|
||||||
next = curve.next,
|
next = curve.next,
|
||||||
lastCurve,
|
prevT,
|
||||||
lastT,
|
prevX0;
|
||||||
lastX0;
|
|
||||||
// Since the curves are monotone in y direction, we can just
|
// Since the curves are monotone in y direction, we can just
|
||||||
// compare the endpoints of the curve to determine if the
|
// compare the endpoints of the curve to determine if the
|
||||||
// ray from query point along +-x direction will intersect
|
// ray from query point along +-x direction will intersect
|
||||||
|
@ -324,9 +323,9 @@ PathItem.inject(new function() {
|
||||||
- x0) <= tolerance
|
- x0) <= tolerance
|
||||||
// Detect 2nd case of a consecutive intercept, but make
|
// Detect 2nd case of a consecutive intercept, but make
|
||||||
// sure we're still on the same loop
|
// sure we're still on the same loop
|
||||||
|| lastCurve === curve.previous
|
|| i > 0 && curve.previous === curves[i - 1]
|
||||||
&& abs(lastX0 - x0) < tolerance
|
&& abs(prevX0 - x0) < tolerance
|
||||||
&& lastT > tMax && t < tMin)) {
|
&& prevT > tMax && t < tMin)) {
|
||||||
// Take care of cases where the curve and the preceding
|
// Take care of cases where the curve and the preceding
|
||||||
// curve merely touches the ray towards +-x direction,
|
// curve merely touches the ray towards +-x direction,
|
||||||
// but proceeds to the same side of the ray.
|
// but proceeds to the same side of the ray.
|
||||||
|
@ -348,9 +347,8 @@ PathItem.inject(new function() {
|
||||||
windRight += winding;
|
windRight += winding;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
lastCurve = curve;
|
prevT = t;
|
||||||
lastT = t;
|
prevX0 = x0;
|
||||||
lastX0 = x0;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue