Group objects drag implemented

This commit is contained in:
barsdeveloper
2021-10-04 23:07:40 +02:00
parent 0563663dfc
commit 0bb3a1ca3e
9 changed files with 122 additions and 84 deletions

View File

@@ -33,7 +33,7 @@ export default class UDrag extends UMouseClickDrag {
return
}
this.target.addLocation(d)
this.target.dragDispatch(d)
// Reassign the position of mouse
this.mousePosition = mousePosition

View File

@@ -8,6 +8,7 @@ export default class UMouseClickDrag extends UPointing {
super(target, blueprint, options)
this.clickButton = options?.clickButton ?? 0
this.exitAnyButton = options?.exitAnyButton ?? true
this.moveEverywhere = options?.moveEverywhere ?? false
this.looseTarget = options?.looseTarget ?? false
this.started = false
this.clickedPosition = [0, 0]

View File

@@ -7,7 +7,6 @@ export default class UPointing {
this.target = target
/** @type {import("../UEBlueprint").default}" */
this.blueprint = blueprint
this.moveEverywhere = options?.moveEverywhere ?? false
this.movementSpace = this.blueprint?.getGridDOMElement() ?? document.documentElement
}

View File

@@ -4,8 +4,6 @@ export default class USelect extends UMouseClickDrag {
constructor(target, blueprint, options) {
super(target, blueprint, options)
this.blueprint = blueprint // blueprint is needed
this.stepSize = options?.stepSize
this.mousePosition = [0, 0]
}