mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-03 19:45:44 -05:00
Use Math..SQRT1_2 instead of 0.7071
Makes code easier to understand.
This commit is contained in:
parent
f160e74936
commit
3b8d3cc47d
1 changed files with 3 additions and 4 deletions
|
@ -611,10 +611,9 @@ PathItem.inject(new function() {
|
||||||
// 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. If the tangent is less
|
// curve's direction at that point. If the tangent is less
|
||||||
// than 45° (y of tangent < sqrt(0.5)), cast the ray
|
// than 45°, cast the ray vertically, else horizontally.
|
||||||
// vertically, otherwise horizontally.
|
dir = abs(curve.getTangentAtTime(t).normalize().y)
|
||||||
dir = abs(curve.getTangentAtTime(t).normalize().y) < 0.7071
|
< Math.SQRT1_2 ? 1 : 0;
|
||||||
? 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