mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-08 05:42:07 -05:00
Rewrite 04cab797db
to only use one return statement.
This commit is contained in:
parent
99d969e962
commit
1b343d5347
1 changed files with 4 additions and 4 deletions
|
@ -1593,10 +1593,10 @@ new function() { // Scope for intersection using bezier fat-line clipping
|
||||||
for (var i = 1, l = part.length; i < l; i++) {
|
for (var i = 1, l = part.length; i < l; i++) {
|
||||||
var qx = part[i][0],
|
var qx = part[i][0],
|
||||||
qy = part[i][1];
|
qy = part[i][1];
|
||||||
if (qy == threshold) {
|
if (top ? qy >= threshold : qy <= threshold) {
|
||||||
return qx;
|
return qy === threshold ? qx
|
||||||
} else if (top ? qy > threshold : qy < threshold)
|
: px + (threshold - py) * (qx - px) / (qy - py);
|
||||||
return px + (threshold - py) * (qx - px) / (qy - py);
|
}
|
||||||
px = qx;
|
px = qx;
|
||||||
py = qy;
|
py = qy;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue