Clean up code formatting.

This commit is contained in:
Jürg Lehni 2015-01-04 22:37:27 +01:00
parent 8928eaffd0
commit 5d875f2d83

View file

@ -297,7 +297,8 @@ PathItem.inject(new function() {
values = curve.values,
winding = curve.winding,
next = curve.next,
lastT, lastX0;
lastT,
lastX0;
// Since the curves are monotone in y direction, we can just
// compare the endpoints of the curve to determine if the
// ray from query point along +-x direction will intersect
@ -312,13 +313,13 @@ PathItem.inject(new function() {
// Due to numerical precision issues, two consecutive curves
// may register an intercept twice, at t = 1 and 0, if y is
// almost equal to one of the endpoints of the curves.
if (!(lastT && abs(lastX0 - x0) < tolerance
&& ((lastT <= tMin && t >= tMax)
|| (t <= tMin && lastT >= tMax)))) {
if (!(lastT !== null && abs(lastX0 - x0) < tolerance
&& (lastT <= tMin && t >= tMax
|| t <= tMin && lastT >= tMax))) {
// Take care of cases where the curve and the preceding
// curve merely touches the ray towards +-x direction, but
// proceeds to the same side of the ray. This essentially is
// not a crossing.
// curve merely touches the ray towards +-x direction,
// but proceeds to the same side of the ray.
// This essentially is not a crossing.
if (Numerical.isZero(slope) && !Curve.isLinear(values)
|| t < tMin && slope * Curve.evaluate(
curve.previous.values, t, 1).y < 0) {