From cb5952c770733b667602952e6b63c5953b89ad34 Mon Sep 17 00:00:00 2001 From: Jeff Emmett Date: Mon, 2 Mar 2026 20:44:15 -0800 Subject: [PATCH] fix: allow tool placement over existing shapes on canvas Move pendingTool check before the e.target gate so clicking anywhere on the canvas places the tool, even over existing elements. Co-Authored-By: Claude Opus 4.6 --- website/canvas.html | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/website/canvas.html b/website/canvas.html index a29a08c..61e3c8d 100644 --- a/website/canvas.html +++ b/website/canvas.html @@ -4470,10 +4470,9 @@ canvas.addEventListener("pointerdown", (e) => { if (isTouchPanning) return; // two-finger gesture owns the canvas - if (e.target !== canvas && e.target !== canvasContent) return; - if (connectMode) return; - // Click-to-place: if a pending tool is set, place it at the click position + // Click-to-place: pendingTool takes priority over all other interactions + // (must run before the target gate so clicks on existing shapes still place) if (pendingTool) { e.preventDefault(); e.stopPropagation(); @@ -4490,6 +4489,9 @@ return; } + if (e.target !== canvas && e.target !== canvasContent) return; + if (connectMode) return; + // Whiteboard tool active → don't select or pan if (wbTool) return;