merge: double-click port → start cable draw (dali's variant)
Adds armTool('cable') so the cursor shows crosshair during the
in-progress draw — matches m's literal 'cursor crosshair' request.
(Picasso shipped a similar fix in parallel due to a head dispatch
race; dropping picasso's variant in favour of this one.)
This commit is contained in:
@@ -471,6 +471,18 @@ function renderCanvas() {
|
||||
});
|
||||
// Port-click drives both cable-draw (slice 7) and port-select (this fix).
|
||||
c.addEventListener("pointerdown", (e) => onPortPointerDown(e, prt));
|
||||
// Double-click activates cable-draw mode from this port without arming
|
||||
// the cable tool first. armTool("cable") gives the crosshair cursor;
|
||||
// the next port-click is then caught by onPortPointerDown's
|
||||
// cable-draw-in-progress branch and commits the cable.
|
||||
c.addEventListener("dblclick", (e) => {
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
if (state.tool !== "cable") armTool("cable");
|
||||
state.cableDrawFromPortID = prt.id;
|
||||
state.selection = null;
|
||||
render();
|
||||
});
|
||||
g.append(c);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user