mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-08-06 11:09:33 -04:00
Do not pass prevSlope to Curve#getCrossings(), rely on #getPrevious() instead.
This commit is contained in:
parent
4a53503130
commit
e573fe5dcd
2 changed files with 5 additions and 9 deletions
src/path
|
@ -1189,14 +1189,9 @@ var Path = this.Path = PathItem.extend(/** @lends Path# */{
|
|||
// number, meaning the starting point is inside the shape.
|
||||
// http://en.wikipedia.org/wiki/Point_in_polygon
|
||||
var curves = this.getCurves(),
|
||||
prevCurve = this.getLastCurve(),
|
||||
crossings = 0;
|
||||
for (var i = 0, l = curves.length; i < l; i++) {
|
||||
var curve = curves[i];
|
||||
crossings += curve.getCrossings(point,
|
||||
prevCurve.getTangent(1).y);
|
||||
prevCurve = curve;
|
||||
}
|
||||
for (var i = 0, l = curves.length; i < l; i++)
|
||||
crossings += curves[i].getCrossings(point, matrix);
|
||||
return (crossings & 1) == 1;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue