Rewrite 04cab797db to only use one return statement.

This commit is contained in:
Jürg Lehni 2015-10-06 16:31:30 +02:00
parent 99d969e962
commit 1b343d5347

View file

@ -1593,10 +1593,10 @@ new function() { // Scope for intersection using bezier fat-line clipping
for (var i = 1, l = part.length; i < l; i++) {
var qx = part[i][0],
qy = part[i][1];
if (qy == threshold) {
return qx;
} else if (top ? qy > threshold : qy < threshold)
return px + (threshold - py) * (qx - px) / (qy - py);
if (top ? qy >= threshold : qy <= threshold) {
return qy === threshold ? qx
: px + (threshold - py) * (qx - px) / (qy - py);
}
px = qx;
py = qy;
}