Revert "Switch to using 0, 1 instead of tMin, tMax for tangents."

This reverts commit edfabcbbd8.

; Conflicts:
;	src/path/PathItem.Boolean.js
This commit is contained in:
Jürg Lehni 2015-08-23 21:48:16 +02:00
parent 92ec09f451
commit 68832e0690

View file

@ -446,7 +446,13 @@ PathItem.inject(new function() {
, 'green');
}
var paths = [];
var paths = [],
// Values for getTangentAt() that are almost 0 and 1.
// NOTE: Even though getTangentAt() supports 0 and 1 instead of
// tMin and tMax, we still need to use this instead, as other issues
// emerge from switching to 0 and 1 in edge cases!
tMin = /*#=*/Numerical.TOLERANCE,
tMax = 1 - tMin;
for (var i = 0, seg, startSeg, l = segments.length; i < l; i++) {
seg = startSeg = segments[i];
if (seg._visited || !operator(seg._winding)) {
@ -480,14 +486,14 @@ PathItem.inject(new function() {
var c1 = seg.getCurve();
if (dir > 0)
c1 = c1.getPrevious();
var t1 = c1.getTangentAt(dir < 0 ? 0 : 1, true),
var t1 = c1.getTangentAt(dir < 0 ? tMin : tMax, true),
// Get both curves at the intersection (except the
// entry curves).
c4 = interSeg.getCurve(),
c3 = c4.getPrevious(),
// Calculate their winding values and tangents.
t3 = c3.getTangentAt(1, true),
t4 = c4.getTangentAt(0, true),
t3 = c3.getTangentAt(tMax, true),
t4 = c4.getTangentAt(tMin, true),
// Cross product of the entry and exit tangent
// vectors at the intersection, will let us select
// the correct contour to traverse next.