diff --git a/js/events.js b/js/events.js index 557658b..14e507e 100644 --- a/js/events.js +++ b/js/events.js @@ -90,7 +90,7 @@ export function initEvents() { } state.gates.push(newGate); evaluateAll(); - state.placingGate = null; + // Keep placingGate active so user can place multiple — right-click to cancel return; } @@ -172,6 +172,13 @@ export function initEvents() { canvas.addEventListener('contextmenu', e => { e.preventDefault(); + + // Right-click cancels placing mode + if (state.placingGate) { + state.placingGate = null; + return; + } + const world = screenToWorld(e.offsetX, e.offsetY); const port = findPortAt(world.x, world.y); if (port && port.type === 'input') {