From 7ce7bc28465577c23c8dc77b9789d9bb958894fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=AF=9B=E9=B9=8F?= <729164035@qq.com> Date: Sun, 9 Nov 2025 00:32:55 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E9=83=A8=E5=88=86=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E7=9A=84=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mango-console/src/components/FlowChart.vue | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/mango-console/src/components/FlowChart.vue b/mango-console/src/components/FlowChart.vue index 500dfd53..481756e7 100644 --- a/mango-console/src/components/FlowChart.vue +++ b/mango-console/src/components/FlowChart.vue @@ -277,7 +277,10 @@ const getCanvasPosition = (clientX: number, clientY: number): Position => { const el = canvasRef.value! const rect = el.getBoundingClientRect() - return { x: clientX - rect.left, y: clientY - rect.top } + // 获取画布的滚动位置 + const scrollLeft = el.scrollLeft + const scrollTop = el.scrollTop + return { x: clientX - rect.left + scrollLeft, y: clientY - rect.top + scrollTop } } // 放置到画布:创建节点 @@ -791,7 +794,7 @@ } .edges { - position: absolute; + position: relative; top: 0; left: 0; width: 100%;