Small fixes

This commit is contained in:
barsdeveloper
2022-01-08 18:57:37 +01:00
parent a6ff4161e8
commit 41b741e8b8
12 changed files with 175 additions and 116 deletions

View File

@@ -61,4 +61,11 @@ export default class SelectableDraggable extends GraphElement {
})
this.blueprint.dispatchEvent(dragEvent)
}
snapToGrid() {
let snappedLocation = this.blueprint.snapToGrid(this.location)
if (this.location[0] != snappedLocation[0] || this.location[1] != snappedLocation[1]) {
this.setLocation(snappedLocation)
}
}
}