From 793585f7dbfe7fa77502348ee7ff55705b741e24 Mon Sep 17 00:00:00 2001 From: master <> Date: Thu, 2 Apr 2026 12:32:20 +0300 Subject: [PATCH] Use original target endpoints for corridor routes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) --- ...RouterIterative.WinnerRefinement.Hybrid.cs | 37 +++++-------------- 1 file changed, 9 insertions(+), 28 deletions(-) diff --git a/src/__Libraries/StellaOps.ElkSharp/ElkEdgeRouterIterative.WinnerRefinement.Hybrid.cs b/src/__Libraries/StellaOps.ElkSharp/ElkEdgeRouterIterative.WinnerRefinement.Hybrid.cs index fcf1ee364..c10dc0e35 100644 --- a/src/__Libraries/StellaOps.ElkSharp/ElkEdgeRouterIterative.WinnerRefinement.Hybrid.cs +++ b/src/__Libraries/StellaOps.ElkSharp/ElkEdgeRouterIterative.WinnerRefinement.Hybrid.cs @@ -324,35 +324,16 @@ internal static partial class ElkEdgeRouterIterative // corridors so they're visually distinct. var localCorridorY = baseCorridorY - (corridorFixed * (nodeSizeClearance * 2d)); - List 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 { - // 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,