lineDir = linePosition < y ? 3 : 1;
routeLineDoesNotIntersectTerminal = linePosition <= minY || linePosition >= maxY
|| boundingBoxesIntersect /* we ignore intersection in this case */;
}
else {
lineDir = linePosition < y ? 3 : 1;
routeLineDoesNotIntersectTerminal = linePosition <= minY || linePosition >= maxY
|| boundingBoxesIntersect /* we ignore intersection in this case */;
}
else {
lineDir = linePosition < x ? 2 : 0;
routeLineDoesNotIntersectTerminal = linePosition <= minX || linePosition >= maxX
|| boundingBoxesIntersect /* we ignore intersection in this case */;
}
// We can route the connection directly to the right direction
lineDir = linePosition < x ? 2 : 0;
routeLineDoesNotIntersectTerminal = linePosition <= minX || linePosition >= maxX
|| boundingBoxesIntersect /* we ignore intersection in this case */;
}
// We can route the connection directly to the right direction
- if(routeLineDoesNotIntersectTerminal &&
+ if((routeLineDoesNotIntersectTerminal ||
+ (line.isHorizontal && (x == minX || x == maxX)) || // already on the top/bottom edge
+ (!line.isHorizontal && (y == minY || y == maxY)) // already on the left/right edge
+ ) &&
Directions.isAllowed(allowedDirections, lineDir)) {
RouteLine line0 = createLine0(lineDir);
new RouteLink(line0, line);
Directions.isAllowed(allowedDirections, lineDir)) {
RouteLine line0 = createLine0(lineDir);
new RouteLink(line0, line);