fix(drag): properly expand parent

This commit is contained in:
bcakmakoglu
2022-05-27 23:36:01 +02:00
committed by Braks
parent 8af74259ec
commit 048775df29
3 changed files with 2 additions and 12 deletions
@@ -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'
+1 -4
View File
@@ -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)
-7
View File
@@ -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
)!
}
}
}