feat(canvas): 连线自动绕开节点并支持拖拽弯折

This commit is contained in:
2026-10-12 13:35:40 +08:00
parent 5a0cbeb429
commit c429209e50
2 changed files with 189 additions and 13 deletions
+4
View File
@@ -130,6 +130,10 @@ export function normalizeDoc(raw) {
const edge = { id: e.id, from: e.from, to: e.to }
if (['top', 'right', 'bottom', 'left'].includes(e.fromSide)) edge.fromSide = e.fromSide
if (['top', 'right', 'bottom', 'left'].includes(e.toSide)) edge.toSide = e.toSide
if (Number.isFinite(e.bendX) && Number.isFinite(e.bendY)) {
edge.bendX = Math.max(-10000, Math.min(10000, e.bendX))
edge.bendY = Math.max(-10000, Math.min(10000, e.bendY))
}
doc.edges.push(edge)
}
}