mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-05 20:32:00 -05:00
Simplify the horizontal curve case in _getWinding method
This commit is contained in:
parent
16ecbbafad
commit
a62a54d7c1
1 changed files with 1 additions and 4 deletions
|
@ -456,10 +456,7 @@ var Curve = Base.extend(/** @lends Curve# */{
|
|||
// curves may report wrong winding contribution. See
|
||||
// PathItem#_getWinding for details on how we resolve this issue.
|
||||
tolerance = /*#=*/ Numerical.TOLERANCE,
|
||||
vDiff = Math.abs(v[1] - v[7]),
|
||||
linear = Curve.isLinear(v) || Curve.isFlatEnough(v, tolerance),
|
||||
horizontal = (linear && vDiff < tolerance) ||
|
||||
(Curve.getLength(v) < 1 && vDiff < 0.01);
|
||||
horizontal = (Curve.isLinear(v) && Math.abs(v[1] - v[7]) < tolerance);
|
||||
// Call the parent's _getWinding method
|
||||
return (path._parent instanceof CompoundPath ? path._parent
|
||||
: path)._getWinding(point, horizontal);
|
||||
|
|
Loading…
Reference in a new issue