Selector element added

This commit is contained in:
barsdeveloper
2021-10-10 15:34:12 +02:00
parent 82355b9126
commit 16fd34fa84
9 changed files with 229 additions and 190 deletions

View File

@@ -6,19 +6,20 @@ export default class Select extends MouseClickDrag {
super(target, blueprint, options)
this.stepSize = options?.stepSize
this.mousePosition = [0, 0]
this.selectorElement = this.blueprint.selectorElement
}
startDrag() {
this.blueprint.startSelecting(this.clickedPosition)
this.selectorElement.startSelecting(this.clickedPosition)
}
dragTo(location, movement) {
this.blueprint.doSelecting(location)
this.selectorElement.doSelecting(location)
}
endDrag() {
if (this.started) {
this.blueprint.finishSelecting()
this.selectorElement.finishSelecting()
} else {
this.blueprint.unselectAll()
}