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 <noreply@anthropic.com>
This commit is contained in:
Jeff Emmett 2026-03-02 20:44:15 -08:00
parent e4ad1b68e9
commit cb5952c770
1 changed files with 5 additions and 3 deletions

View File

@ -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;