Revert right-side End approach, use simple vertical corridor drops
The right-side wrapping added complexity near the End node where 3 other edges already converge. Simple vertical drops from the corridor to End's top face are cleaner — no extra bends or horizontal stubs in the congested area. Two corridors with 2x nodeSizeClearance separation (~105px), straight vertical drops at distinct X positions on End's top face. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -30,7 +30,7 @@
|
||||
}
|
||||
},
|
||||
"Routing": {
|
||||
"DefaultTimeout": "30s",
|
||||
"DefaultTimeout": "60s",
|
||||
"MaxRequestBodySize": "100MB",
|
||||
"StreamingEnabled": true,
|
||||
"PreferLocalRegion": true,
|
||||
|
||||
@@ -319,30 +319,13 @@ internal static partial class ElkEdgeRouterIterative
|
||||
var src = cpath[0];
|
||||
var tgt = cpath[^1];
|
||||
var stubX = src.X + 24d;
|
||||
var tgtNode = nodesById.TryGetValue(edge.TargetNodeId ?? string.Empty, out var tn) ? tn : null;
|
||||
|
||||
// Both corridors go ABOVE the graph but with large vertical
|
||||
// separation (2x nodeSizeClearance) so they're visually distinct.
|
||||
// Large vertical separation (2x nodeSizeClearance) between
|
||||
// corridors so they're visually distinct. Simple vertical
|
||||
// drop to target — no right-side wrapping that congests
|
||||
// the area near the End node.
|
||||
var localCorridorY = baseCorridorY - (corridorFixed * (nodeSizeClearance * 2d));
|
||||
|
||||
List<ElkPoint> newPath;
|
||||
if (tgtNode is not null && tgtNode.Kind is "End")
|
||||
{
|
||||
// Enter End from the right side at a distinct Y position.
|
||||
var rightApproachX = tgtNode.X + tgtNode.Width + 24d + (corridorFixed * (nodeSizeClearance + 4d));
|
||||
var slotFraction = corridorFixed == 0 ? 0.33d : 0.67d;
|
||||
var entryY = tgtNode.Y + (tgtNode.Height * slotFraction);
|
||||
newPath =
|
||||
[
|
||||
src,
|
||||
new() { X = stubX, Y = src.Y },
|
||||
new() { X = stubX, Y = localCorridorY },
|
||||
new() { X = rightApproachX, Y = localCorridorY },
|
||||
new() { X = rightApproachX, Y = entryY },
|
||||
new() { X = tgtNode.X + tgtNode.Width, Y = entryY },
|
||||
];
|
||||
}
|
||||
else
|
||||
{
|
||||
newPath =
|
||||
[
|
||||
|
||||
Reference in New Issue
Block a user