mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-07-27 22:29:11 -04:00
Use < instead of <= when comparing against TOLERANCE
This commit is contained in:
parent
26cdbb6805
commit
c1485e7068
2 changed files with 6 additions and 6 deletions
src/path
|
@ -138,15 +138,15 @@ PathItem.inject(new function() {
|
|||
if (length <= curveLength) {
|
||||
// If the selected location on the curve falls onto its
|
||||
// beginning or end, use the curve's center instead.
|
||||
if (length <= tolerance
|
||||
|| curveLength - length <= tolerance)
|
||||
if (length < tolerance
|
||||
|| curveLength - length < tolerance)
|
||||
length = curveLength / 2;
|
||||
var curve = node.segment.getCurve(),
|
||||
pt = curve.getPointAt(length),
|
||||
// Determine if the curve is a horizontal linear
|
||||
// curve by checking the slope of it's tangent.
|
||||
hor = curve.isLinear() && Math.abs(curve
|
||||
.getTangentAt(0.5, true).y) <= tolerance,
|
||||
.getTangentAt(0.5, true).y) < tolerance,
|
||||
path = curve._path;
|
||||
if (path._parent instanceof CompoundPath)
|
||||
path = path._parent;
|
||||
|
@ -320,7 +320,7 @@ PathItem.inject(new function() {
|
|||
// Detect and exclude intercepts at 'end' of loops:
|
||||
&& (i === l - 1 || curve.next !== curves[i + 1])
|
||||
&& abs(Curve.evaluate(curve.next.values, 0, 0).x -x)
|
||||
<= tolerance
|
||||
< tolerance
|
||||
// Detect 2nd case of a consecutive intercept, but make
|
||||
// sure we're still on the same loop
|
||||
|| i > 0 && curve.previous === curves[i - 1]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue