修复首次打开画布无法加载节点问题

This commit is contained in:
X1627315083@163.com
2026-03-24 10:53:41 +08:00
parent 54f786e94b
commit f8f760119c
2 changed files with 8 additions and 4 deletions

View File

@@ -54,6 +54,7 @@ export class NodeManager {
return current.data.createIndexPosition > max.data.createIndexPosition ? current : max
}, superiorGenerateNodes[0])
const snode = superiorID ? this.stateManager.flowManager.getNodeById(superiorID) : this.stateManager.flowManager.getLastNode();
console.log(snode)
const id = options.id || createId()
const positionX = options.positionX || 0
const positionY = options.positionY || 0
@@ -65,10 +66,14 @@ export class NodeManager {
{
x: endGenerateNode.position.x + positionX,
y: endGenerateNode.position.y + positionY + this.ranksep + 200
} :
} : snode ?
{
x: snode.position.x + snode.dimensions.width + this.nodesep + positionX,
y: snode.position.y + positionY
} :
{
x: positionX,
y: positionY
}
)
const data = options?.data || {}