mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-05 20:32:00 -05:00
Merge pull request #1155 from iconexperience/propagateWinding-pythagoras-fix
Use correct value for y 45 degree tangent
This commit is contained in:
commit
1f822b1faa
1 changed files with 4 additions and 3 deletions
|
@ -613,9 +613,10 @@ PathItem.inject(new function() {
|
||||||
pt = curve.getPointAtTime(t),
|
pt = curve.getPointAtTime(t),
|
||||||
// Determine the direction in which to check the winding
|
// Determine the direction in which to check the winding
|
||||||
// from the point (horizontal or vertical), based on the
|
// from the point (horizontal or vertical), based on the
|
||||||
// curve's direction at that point.
|
// curve's direction at that point. If the tangent is less
|
||||||
dir = abs(curve.getTangentAtTime(t).normalize().y) < 0.5
|
// than 45°, cast the ray vertically, else horizontally.
|
||||||
? 1 : 0;
|
dir = abs(curve.getTangentAtTime(t).normalize().y)
|
||||||
|
< Math.SQRT1_2 ? 1 : 0;
|
||||||
if (parent instanceof CompoundPath)
|
if (parent instanceof CompoundPath)
|
||||||
path = parent;
|
path = parent;
|
||||||
// While subtracting, we need to omit this curve if it is
|
// While subtracting, we need to omit this curve if it is
|
||||||
|
|
Loading…
Reference in a new issue