Improve comments.

This commit is contained in:
Jürg Lehni 2013-05-04 03:20:53 -07:00
parent e1ef69f23a
commit 31a45bad97

View file

@ -45,6 +45,7 @@ PathItem.inject(new function() {
// to compare both at the same time // to compare both at the same time
? (loc1.getIndex() + loc1.getParameter()) ? (loc1.getIndex() + loc1.getParameter())
- (loc2.getIndex() + loc2.getParameter()) - (loc2.getIndex() + loc2.getParameter())
// Sort by path id to group all locations on the same path.
: path1._id - path2._id; : path1._id - path2._id;
}); });
var others = collectOthers && []; var others = collectOthers && [];
@ -109,10 +110,10 @@ PathItem.inject(new function() {
|| _path1.getIntersections(_path2); || _path1.getIntersections(_path2);
// if we have a empty _cache object as an operand, skip calculating // if we have a empty _cache object as an operand, skip calculating
// boolean and cache the intersections // boolean and cache the intersections
if (_cache && !_cache.intersections) { // if (_cache && !_cache.intersections) {
// TODO: Don't we need to clear up and remove _path1 & _path2 again? // // TODO: Don't we need to clear up and remove _path1 & _path2 again?
return _cache.intersections = intersections; // return _cache.intersections = intersections;
} // }
// Now split intersections on both curves, by asking the first call to // Now split intersections on both curves, by asking the first call to
// collect the 'other' intersections for us and passing that on to the // collect the 'other' intersections for us and passing that on to the
// second call. // second call.
@ -144,6 +145,8 @@ PathItem.inject(new function() {
&& (clockwise === path2Clockwise && (clockwise === path2Clockwise
|| !testOnCurve(_path2, midPoint)); || !testOnCurve(_path2, midPoint));
if (operator(path === _path1, insidePath1, insidePath2)) { if (operator(path === _path1, insidePath1, insidePath2)) {
// Mark as invalid, but do not remove yet, so the graph
// structure is preserved.
segment._invalid = true; segment._invalid = true;
} else { } else {
segments.push(segment); segments.push(segment);