From db5c77851d9e15b58f6fc07f2dfb06090f7e32bb Mon Sep 17 00:00:00 2001 From: chiyi Date: Mon, 12 Oct 2026 14:32:02 +0800 Subject: [PATCH] =?UTF-8?q?fix(canvas):=20=E7=82=B9=E5=87=BB=E7=A9=BA?= =?UTF-8?q?=E7=99=BD=E6=B8=85=E9=99=A4=E8=8A=82=E7=82=B9/=E8=BF=9E?= =?UTF-8?q?=E7=BA=BF=E9=80=89=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/canvas/CanvasStage.vue | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/frontend/src/components/canvas/CanvasStage.vue b/frontend/src/components/canvas/CanvasStage.vue index 0de29c4..298614d 100644 --- a/frontend/src/components/canvas/CanvasStage.vue +++ b/frontend/src/components/canvas/CanvasStage.vue @@ -373,6 +373,11 @@ function onPointerDown(e) { const wantPan = e.button === 1 || e.button === 2 || spaceHeld.value || (!node && !e.shiftKey && e.button === 0) if (wantPan) { + // 空白左键点击 = 平移画布,同时清空节点/连线选中(点别处失焦) + if (!node && e.button === 0 && !spaceHeld.value) { + clearSelection() + clearEdgeSel() + } panning.value = true act = { mode: 'pan', px: p.x, py: p.y, vx: vp.x, vy: vp.y } try { stageEl.value.setPointerCapture(e.pointerId) } catch { /* 合成/失效指针 */ }