From 4dc84361ba2822dcfccd1bfb41941ef9df98edca Mon Sep 17 00:00:00 2001 From: niknah Date: Wed, 4 Mar 2026 08:32:41 +1100 Subject: [PATCH] Fix problem with missing round corners before input --- js/CircuitBoardLines.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/js/CircuitBoardLines.js b/js/CircuitBoardLines.js index ae268dc..19efbf0 100644 --- a/js/CircuitBoardLines.js +++ b/js/CircuitBoardLines.js @@ -556,6 +556,21 @@ class MapLinks { if (!inputBlockedByNode && !outputBlockedByNode) { const isBlocked = {}; const pathFound = this.mapLink(outputXY, inputXY, nodeInfo, isBlocked, null); + + if (pathFound) { + // remove duplicate dot at the end + while (pathFound.length >= 2) { + const lastPathPoint1 = pathFound[pathFound.length - 1]; + const lastPathPoint2 = pathFound[pathFound.length - 2]; + if (lastPathPoint1[0] === lastPathPoint2[0] + && lastPathPoint1[1] === lastPathPoint2[1] + ) { + pathFound.pop(); + } else { + break; + } + } + } // Draw a direct line when it's blocked (isBlocked.blocked) if (!isBlocked.blocked && pathFound && pathFound.length > 2) { // mapLink() may have expanded the linesArea,