Files
ueblueprint/js/input/Select.js
2021-11-16 22:12:41 +01:00

26 lines
636 B
JavaScript
Executable File

import MouseClickDrag from "./MouseClickDrag"
export default class Select extends MouseClickDrag {
constructor(target, blueprint, options) {
super(target, blueprint, options)
this.selectorElement = this.blueprint.selectorElement
}
startDrag() {
this.selectorElement.startSelecting(this.clickedPosition)
}
dragTo(location, movement) {
this.selectorElement.doSelecting(location)
}
endDrag() {
if (this.started) {
this.selectorElement.finishSelecting()
} else {
this.blueprint.unselectAll()
}
}
}