feat(ui): double-click a port to start a cable draw

Saves the cable-tool arming step. Double-click sets
state.cableDrawFromPortID + clears selection, then the existing
cable-draw-in-progress branch in onPortPointerDown commits the cable
on the next port click. Esc / plain click still cancels.

Single-click behaviour (select + open port inspector) unchanged.
This commit is contained in:
mAi
2026-05-16 13:25:04 +02:00
parent 40ab3d2630
commit 48647088f9

View File

@@ -471,6 +471,17 @@ function renderCanvas() {
});
// Port-click drives both cable-draw (slice 7) and port-select (this fix).
c.addEventListener("pointerdown", (e) => onPortPointerDown(e, prt));
// Double-click a port → enter cable-draw mode from that port,
// bypassing the cable-tool arming step. The next port-click
// commits the cable (existing cable-draw-in-progress branch in
// onPortPointerDown).
c.addEventListener("dblclick", (e) => {
e.stopPropagation();
e.preventDefault();
state.cableDrawFromPortID = prt.id;
state.selection = null;
render();
});
g.append(c);
}