Skip to content

Commit

Permalink
feat: update timeout for dragging
Browse files Browse the repository at this point in the history
  • Loading branch information
PancakePhilarmonych committed Nov 19, 2023
1 parent 77469b3 commit 0785537
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/modules/GameObject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ export class GameObject {
.on("pointerdown", this.onPointedDown, this)
.on("pointermove", this.onPointerMove, this)
.on("pointerup", this.onPointedUp, this)
.on("pointerupoutside", this.onPointedUp, this)
}

setPosition(x: number, y: number) {
Expand All @@ -62,9 +63,8 @@ export class GameObject {
this.pointerDownTime = Date.now();

this.ponterDownTimeOut = setTimeout(() => {
const timeElapsed = Date.now() - this.pointerDownTime;
if (timeElapsed > 100) this.isDragging = true;
}, 100);
this.isDragging = true;
}, 20);
}

onPointerMove() {
Expand Down

0 comments on commit 0785537

Please sign in to comment.