feat(canvas): 四向点选连线并统一 10% 缩放步进
为所有画布节点显示四向连接点,点击起点与终点连线并保存端点方向;滚轮、按钮与快捷键按 10% 递增。 Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
@@ -127,7 +127,10 @@ export function normalizeDoc(raw) {
|
||||
if (!e || typeof e.id !== 'string') continue
|
||||
if (typeof e.from !== 'string' || typeof e.to !== 'string') continue
|
||||
if (!ids.has(e.from) || !ids.has(e.to) || e.from === e.to) continue
|
||||
doc.edges.push({ id: e.id, from: e.from, to: e.to })
|
||||
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
|
||||
doc.edges.push(edge)
|
||||
}
|
||||
}
|
||||
return doc
|
||||
|
||||
Reference in New Issue
Block a user