fix(drag): properly expand parent
This commit is contained in:
@@ -6,4 +6,4 @@ export { default as SmoothStepEdge } from './SmoothStepEdge'
|
||||
export { default as StraightEdge } from './StraightEdge'
|
||||
export { default as EdgeAnchor } from './EdgeAnchor'
|
||||
export { default as EdgeText } from './EdgeText.vue'
|
||||
export { default as EdgeWrapper } from './EdgeWrapper.vue'
|
||||
export { default as EdgeWrapper } from './Wrapper'
|
||||
|
||||
@@ -98,10 +98,7 @@ function useDrag(params: UseDragParams) {
|
||||
}
|
||||
})
|
||||
.on('drag', (event: UseDragEvent) => {
|
||||
if (node && (lastPos.x !== node.position.x || lastPos.y !== node.position.y)) {
|
||||
lastPos.x = node.position.x
|
||||
lastPos.y = node.position.y
|
||||
}
|
||||
parentPos = getParentNodePosition(node && node.parentNode ? getNode(node!.parentNode!) : undefined)
|
||||
|
||||
const mousePos = getMousePosition(event)
|
||||
|
||||
|
||||
@@ -70,13 +70,6 @@ function handleParentExpand(updateItem: GraphNode, parent: GraphNode) {
|
||||
}
|
||||
updateItem.position.y = 0
|
||||
}
|
||||
|
||||
parent.dimensions.width = (
|
||||
typeof parent.style.width === 'string' ? parseInt((<string>parent.style.width)!, 10) : parent.style.width
|
||||
)!
|
||||
parent.dimensions.height = (
|
||||
typeof parent.style.height === 'string' ? parseInt((<string>parent.style.height)!, 10) : parent.style.height
|
||||
)!
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user