Improve code comments a bit.

This commit is contained in:
Jürg Lehni 2013-05-04 11:13:38 -07:00
parent d911c7b12a
commit 6da97b894f

View file

@ -108,12 +108,10 @@ PathItem.inject(new function() {
// Calculate all the intersections // Calculate all the intersections
intersections = _cache && _cache.intersections intersections = _cache && _cache.intersections
|| path1.getIntersections(path2); || path1.getIntersections(path2);
// if we have a empty _cache object as an operand, skip calculating // If we have an 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?
// return _cache.intersections = intersections; // return _cache.intersections = intersections;
// }
// Now split intersections on both paths, by asking the first call to // Now split intersections on both paths, by asking the first call to
// collect the intersections on the other path for us and passing the // collect the intersections on the other path for us and passing the
// result of that on to the second call. // result of that on to the second call.
@ -206,19 +204,13 @@ PathItem.inject(new function() {
return false; return false;
} }
// A boolean operator is a binary operator function of the form // Boolean operators are binary operator functions of the form:
// function(isPath1, isInPath1, isInPath2) // function(isPath1, isInPath1, isInPath2)
// //
// Operators return true if a curve in the operands is to be removed, // Operators return true if a segment in the operands is to be discarded.
// and they aare called for each curve segment in the graph after all the // They are called for each segment in the graph after all the intersections
// intersections between the operands are calculated and curves in the // between the operands are calculated and curves in the operands were split
// operands were split at intersections. // at intersections.
//
// The boolean operator return a Boolean value indicating whether to
// keep the curve or not.
// return true - discard the curve
// return false - keep the curve
return /** @lends Path# */{ return /** @lends Path# */{
/** /**
* Merges the geometry of the specified path from this path's * Merges the geometry of the specified path from this path's