Node selection fix

This commit is contained in:
barsdeveloper
2022-04-02 23:12:26 +02:00
parent 7d72015bb5
commit 2456caf2b7
4 changed files with 45 additions and 37 deletions

View File

@@ -22,6 +22,11 @@ export default class MouseMoveNodes extends IMouseClickDrag {
startDrag() {
// Get the current mouse position
this.mouseLocation = Utility.snapToGrid(this.clickedPosition, this.stepSize)
if (!this.target.selected) {
this.blueprint.unselectAll()
this.target.setSelected(true)
}
}
dragTo(location, movement) {
@@ -46,4 +51,11 @@ export default class MouseMoveNodes extends IMouseClickDrag {
// Reassign the position of mouse
this.mouseLocation = mouseLocation
}
unclicked() {
if (!this.started) {
this.blueprint.unselectAll()
this.target.setSelected(true)
}
}
}