Files
ueblueprint/js/input/mouse/Select.js
barsdeveloper a0eeca11d1 Various fixes
2022-03-28 23:04:24 +02:00

32 lines
706 B
JavaScript
Executable File

// @ts-check
import IMouseClickDrag from "./IMouseClickDrag"
export default class Select extends IMouseClickDrag {
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()
}
}
unclicked() {
if (!this.started) {
this.blueprint.unselectAll()
}
}
}