mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-05 20:32:00 -05:00
Use hullEpsilon in all comparisons of curve time values in fat-line clipping code.
Addresses first half of issue #568
This commit is contained in:
parent
41c0584f35
commit
74844d8a2b
1 changed files with 1 additions and 2 deletions
|
@ -1085,7 +1085,6 @@ new function() { // Scope for methods that require numerical integration
|
|||
return;
|
||||
// Let P be the first curve and Q be the second
|
||||
var q0x = v2[0], q0y = v2[1], q3x = v2[6], q3y = v2[7],
|
||||
tolerance = /*#=*/Numerical.TOLERANCE,
|
||||
hullEpsilon = 1e-9,
|
||||
// Calculate the fat-line L for Q is the baseline l and two
|
||||
// offsets which completely encloses the curve P.
|
||||
|
@ -1153,7 +1152,7 @@ new function() { // Scope for methods that require numerical integration
|
|||
parts[1], v1, curve2, curve1, locations, include,
|
||||
t, uMax, tMinNew, tMaxNew, tDiff, !reverse, recursion);
|
||||
}
|
||||
} else if (Math.max(uMax - uMin, tMaxNew - tMinNew) < tolerance) {
|
||||
} else if (Math.max(uMax - uMin, tMaxNew - tMinNew) < hullEpsilon) {
|
||||
// We have isolated the intersection with sufficient precision
|
||||
var t1 = tMinNew + (tMaxNew - tMinNew) / 2,
|
||||
t2 = uMin + (uMax - uMin) / 2;
|
||||
|
|
Loading…
Reference in a new issue