mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-02-19 04:55:57 +08:00
Input classes simplified further
This commit is contained in:
@@ -10,25 +10,15 @@ export default class USelect extends UMouseClickDrag {
|
||||
this.mousePosition = [0, 0]
|
||||
}
|
||||
|
||||
clicked(e) {
|
||||
}
|
||||
|
||||
startDrag(e) {
|
||||
startDrag() {
|
||||
this.blueprint.startSelecting(this.clickedPosition)
|
||||
}
|
||||
|
||||
dragTo(e) {
|
||||
let scaleCorrection = 1 / this.blueprint.getScale()
|
||||
const targetOffset = e.target.getBoundingClientRect()
|
||||
const currentTargetOffset = e.currentTarget.getBoundingClientRect()
|
||||
let offset = [
|
||||
e.offsetX + targetOffset.x * scaleCorrection - currentTargetOffset.x * scaleCorrection,
|
||||
e.offsetY + targetOffset.y * scaleCorrection - currentTargetOffset.y * scaleCorrection
|
||||
]
|
||||
this.blueprint.doSelecting(offset)
|
||||
dragTo(location, movement) {
|
||||
this.blueprint.doSelecting(location)
|
||||
}
|
||||
|
||||
endDrag(e) {
|
||||
endDrag() {
|
||||
if (this.started) {
|
||||
this.blueprint.finishSelecting()
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user