Spread corridor entries across End right face

Each corridor edge enters End at a distinct Y position (1/n+1 fraction)
so the highways are visually traceable all the way to the terminus.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
master
2026-04-02 09:57:19 +03:00
parent b9b2ac8b98
commit 7d0fea3149
2 changed files with 41 additions and 11 deletions

View File

@@ -332,11 +332,13 @@ internal static partial class ElkEdgeRouterIterative
// Enter End from the right side: corridor goes past End,
// descends to End's center Y, approaches from right.
// This avoids the ugly long vertical drop from corridor.
// Offset both X and Y for each corridor edge so their
// vertical descent legs don't overlap (parallel vertical
// segments at the same X trigger target-join detection).
// Offset both X and Y for each corridor edge so they
// enter End at distinct positions (visually traceable).
var rightApproachX = tgtNode.X + tgtNode.Width + 24d + (corridorFixed * (nodeSizeClearance + 4d));
var centerY = tgtNode.Y + (tgtNode.Height / 2d);
// Spread entry points across the right face. First edge
// enters at 1/3 from top, second at 2/3, etc.
var slotFraction = (corridorFixed + 1d) / (corridorFixed + 2d);
var centerY = tgtNode.Y + (tgtNode.Height * slotFraction);
newPath =
[
src,