fix
This commit is contained in:
@@ -28,13 +28,17 @@ export class NodeManager {
|
||||
|
||||
/** 创建节点 */
|
||||
createNode(options: NodeOptions) {
|
||||
const lastNode = this.stateManager.flowManager.getLastNode();
|
||||
const superiorID = options?.data?.superiorID
|
||||
const snode = superiorID ? this.stateManager.flowManager.getNodeById(superiorID) : this.stateManager.flowManager.getLastNode();
|
||||
const id = options.id || createId()
|
||||
const positionX = options.positionX || 0
|
||||
const positionY = options.positionY || 0
|
||||
const position = options.position ||
|
||||
!lastNode ? { x: positionX, y: positionY } :
|
||||
{ x: lastNode.position.x + lastNode.dimensions.width + 50 + positionX, y: lastNode.position.y + positionY }
|
||||
!snode ? { x: positionX, y: positionY } :
|
||||
{
|
||||
x: snode.position.x + snode.dimensions.width + 50 + positionX,
|
||||
y: snode.position.y + positionY
|
||||
}
|
||||
const data = options?.data || {}
|
||||
data['component'] = options.component
|
||||
const options_ = {
|
||||
|
||||
Reference in New Issue
Block a user