This commit is contained in:
barsdeveloper
2021-10-09 22:11:11 +02:00
parent 4406b4abe7
commit 84606486c4
15 changed files with 40 additions and 40 deletions

26
js/input/Select.js Normal file
View File

@@ -0,0 +1,26 @@
import MouseClickDrag from "./MouseClickDrag"
export default class Select extends MouseClickDrag {
constructor(target, blueprint, options) {
super(target, blueprint, options)
this.stepSize = options?.stepSize
this.mousePosition = [0, 0]
}
startDrag() {
this.blueprint.startSelecting(this.clickedPosition)
}
dragTo(location, movement) {
this.blueprint.doSelecting(location)
}
endDrag() {
if (this.started) {
this.blueprint.finishSelecting()
} else {
this.blueprint.unselectAll()
}
}
}