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:
@@ -471,6 +471,17 @@ function renderCanvas() {
|
|||||||
});
|
});
|
||||||
// Port-click drives both cable-draw (slice 7) and port-select (this fix).
|
// Port-click drives both cable-draw (slice 7) and port-select (this fix).
|
||||||
c.addEventListener("pointerdown", (e) => onPortPointerDown(e, prt));
|
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);
|
g.append(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user