Rename getIntersection() -> getBestIntersection()

This commit is contained in:
Jürg Lehni 2015-10-07 10:57:43 +02:00
parent bfa0459c52
commit 4fac3ee6fc

View file

@ -595,7 +595,8 @@ PathItem.inject(new function() {
// If there are multiple possible intersections, find the one // If there are multiple possible intersections, find the one
// that's either connecting back to start or is not visited yet, // that's either connecting back to start or is not visited yet,
// and will be part of the boolean result: // and will be part of the boolean result:
function getIntersection(inter, strict) { function getBestIntersection(inter, strict) {
var begin = inter;
while (inter) { while (inter) {
var seg = inter._segment, var seg = inter._segment,
nextSeg = seg.getNext(), nextSeg = seg.getNext(),
@ -681,8 +682,8 @@ PathItem.inject(new function() {
+ ', other: ' + inter._segment._path._id + '.' + ', other: ' + inter._segment._path._id + '.'
+ inter._segment._index); + inter._segment._index);
} }
inter = inter && (getIntersection(inter, true) inter = inter && (getBestIntersection(inter, true)
|| getIntersection(inter, false)) || inter; || getBestIntersection(inter, false)) || inter;
var other = inter && inter._segment; var other = inter && inter._segment;
// A switched intersection means we may have changed the segment // A switched intersection means we may have changed the segment
// Point to the other segment in the selected intersection. // Point to the other segment in the selected intersection.