mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-22 07:19:57 -05:00
Merge pull request #798 from iconexperience/Improve-clipConvexHullPart
Improve clipConvexHullPart()
This commit is contained in:
commit
99d969e962
1 changed files with 3 additions and 1 deletions
|
@ -1593,7 +1593,9 @@ 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 (top ? qy >= threshold : qy <= threshold)
|
if (qy == threshold) {
|
||||||
|
return qx;
|
||||||
|
} else if (top ? qy > threshold : qy < threshold)
|
||||||
return 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