优化部分页面的样式

This commit is contained in:
毛鹏
2025-11-09 00:32:55 +08:00
parent 3e7f0b7205
commit 7ce7bc2846

View File

@@ -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%;