From b80fa7d942268bddf69cdfda92f8bc952108d659 Mon Sep 17 00:00:00 2001 From: Nathan Cahill Date: Sun, 8 Nov 2026 07:26:58 -0600 Subject: [PATCH] fix a click on the temporary anchor (#397) Hovering a line in the routing tool shows a temporary anchor, which is drawn in the anchors' layer with the index one past the last anchor. Clicking it reached onClick, which looked that index up in the anchors, got undefined and threw reading its properties. The click now adds the anchor, as a click on the line does. Co-authored-by: Claude Opus 5.5 Co-authored-by: vcoppe --- .../lib/components/toolbar/tools/routing/routing-controls.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/website/src/lib/components/toolbar/tools/routing/routing-controls.ts b/website/src/lib/components/toolbar/tools/routing/routing-controls.ts index 3acebbb1a..662b3bd7f 100644 --- a/website/src/lib/components/toolbar/tools/routing/routing-controls.ts +++ b/website/src/lib/components/toolbar/tools/routing/routing-controls.ts @@ -633,6 +633,11 @@ export class RoutingControls { const anchor = this.anchors[e.features![0].properties.anchorIndex]; if (!anchor) { + // The temporary anchor on the line is not one of the anchors (nor is a feature + // still rendered from before they were rebuilt), a click on it adds it + if (e.type === 'click') { + this.addIntermediateAnchor(e); + } return; } if (e.originalEvent.shiftKey) {