Fix:修复新创建的关联线位置始终在节点的右侧没有根据相对位置调整的问题

This commit is contained in:
街角小林 2024-01-15 17:50:24 +08:00
parent 62c61b6e53
commit c3652331ea

View File

@ -169,22 +169,26 @@ export const getNodePoint = (node, dir = 'right', range = 0, e = null) => {
case 'left': case 'left':
return { return {
x: left, x: left,
y: top + height / 2 - range y: top + height / 2 - range,
dir
} }
case 'right': case 'right':
return { return {
x: left + width, x: left + width,
y: top + height / 2 - range y: top + height / 2 - range,
dir
} }
case 'top': case 'top':
return { return {
x: left + width / 2 - range, x: left + width / 2 - range,
y: top y: top,
dir
} }
case 'bottom': case 'bottom':
return { return {
x: left + width / 2 - range, x: left + width / 2 - range,
y: top + height y: top + height,
dir
} }
default: default:
break break