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:
parent
e4ad1b68e9
commit
cb5952c770
|
|
@ -4470,10 +4470,9 @@
|
||||||
|
|
||||||
canvas.addEventListener("pointerdown", (e) => {
|
canvas.addEventListener("pointerdown", (e) => {
|
||||||
if (isTouchPanning) return; // two-finger gesture owns the canvas
|
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) {
|
if (pendingTool) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
|
|
@ -4490,6 +4489,9 @@
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (e.target !== canvas && e.target !== canvasContent) return;
|
||||||
|
if (connectMode) return;
|
||||||
|
|
||||||
// Whiteboard tool active → don't select or pan
|
// Whiteboard tool active → don't select or pan
|
||||||
if (wbTool) return;
|
if (wbTool) return;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue