Use original target endpoints for corridor routes
Corridor routes now drop to the ORIGINAL target point (placed by the router on the actual node boundary) instead of computing a new entry point on the rectangle edge. Edges visually connect to the End node. Simplified corridor path: src → stub → corridor → drop to original target. No separate left-face approach needed. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -324,35 +324,16 @@ internal static partial class ElkEdgeRouterIterative
|
||||
// corridors so they're visually distinct.
|
||||
var localCorridorY = baseCorridorY - (corridorFixed * (nodeSizeClearance * 2d));
|
||||
|
||||
List<ElkPoint> newPath;
|
||||
if (tgtNode is not null)
|
||||
// Route through corridor then drop to the ORIGINAL target
|
||||
// endpoint (which the router placed on the actual node boundary).
|
||||
var newPath = new List<ElkPoint>
|
||||
{
|
||||
// Drop to left of target, then approach from the left face.
|
||||
// All End-targeting edges enter from the same direction for
|
||||
// a clean fan-in instead of a 3-face tangle.
|
||||
var dropX = tgtNode.X - 24d - (corridorFixed * (nodeSizeClearance * 2d));
|
||||
var entryY = tgtNode.Y + (tgtNode.Height * (0.33d + corridorFixed * 0.34d));
|
||||
newPath =
|
||||
[
|
||||
src,
|
||||
new() { X = stubX, Y = src.Y },
|
||||
new() { X = stubX, Y = localCorridorY },
|
||||
new() { X = dropX, Y = localCorridorY },
|
||||
new() { X = dropX, Y = entryY },
|
||||
new() { X = tgtNode.X, Y = entryY },
|
||||
];
|
||||
}
|
||||
else
|
||||
{
|
||||
newPath =
|
||||
[
|
||||
src,
|
||||
new() { X = stubX, Y = src.Y },
|
||||
new() { X = stubX, Y = localCorridorY },
|
||||
new() { X = tgt.X, Y = localCorridorY },
|
||||
tgt,
|
||||
];
|
||||
}
|
||||
src,
|
||||
new() { X = stubX, Y = src.Y },
|
||||
new() { X = stubX, Y = localCorridorY },
|
||||
new() { X = tgt.X, Y = localCorridorY },
|
||||
tgt,
|
||||
};
|
||||
corridorResult[ei] = new ElkRoutedEdge
|
||||
{
|
||||
Id = edge.Id, SourceNodeId = edge.SourceNodeId, TargetNodeId = edge.TargetNodeId,
|
||||
|
||||
Reference in New Issue
Block a user