From 73ccf12678e4b6e828ff09ac31d30a6616ca572d Mon Sep 17 00:00:00 2001 From: anti Date: Wed, 22 Apr 2026 16:43:38 -0400 Subject: [PATCH] fix(web): allow MazeNET canvas pan from inside net-box body MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Pan drag previously required mousedown on the bare canvas (target === currentTarget). When zoomed in, net-boxes cover most of the viewport so there was no bare grid to grab. Drop the guard — node/header/port/ resize handlers all call stopPropagation() already, so only net-box body mousedowns bubble up to start the pan, which is exactly what we want. --- decnet_web/src/components/MazeNET/useMazeInteraction.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/decnet_web/src/components/MazeNET/useMazeInteraction.ts b/decnet_web/src/components/MazeNET/useMazeInteraction.ts index 96f93fcd..9833e963 100644 --- a/decnet_web/src/components/MazeNET/useMazeInteraction.ts +++ b/decnet_web/src/components/MazeNET/useMazeInteraction.ts @@ -87,7 +87,10 @@ export function useMazeInteraction({ nets, nodes, setNets, setNodes, canvasRef, const onCanvasMouseDown = useCallback((e: React.MouseEvent) => { if (e.button !== 0) return; - if (e.target !== e.currentTarget) return; + // Pan starts whenever a left-mousedown bubbles up to the canvas. + // Node/header/resize/port handlers call stopPropagation() and never + // reach here; net-box body mousedowns DO bubble so you can pan from + // "inside" a LAN when zoomed in and no bare grid is visible. setDrag({ type: 'pan', startX: e.clientX, startY: e.clientY, panX: panRef.current.x, panY: panRef.current.y }); }, []);