Files
ueblueprint/js/input/mouse/Select.js
2022-02-27 13:02:21 +01:00

26 lines
639 B
JavaScript
Executable File

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()
} else {
this.blueprint.unselectAll()
}
}
}