Skip to content

Commit

Permalink
Merge branch 'libgdx:master' into timer
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanSweet committed Apr 28, 2024
2 parents 7cb4517 + 980fa73 commit e31c43a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
1 change: 1 addition & 0 deletions gdx/src/com/badlogic/gdx/input/GestureDetector.java
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ public boolean isPanning () {
}

public void reset () {
longPressTask.cancel();
touchDownTime = 0;
panning = false;
inTapRectangle = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,20 +116,20 @@ public boolean handle (Event e) {
event.getPointer(), event.getButton());
return true;
case touchUp:
if (event.isTouchFocusCancel()) {
boolean touchFocusCancel = event.isTouchFocusCancel();
if (touchFocusCancel)
detector.reset();
actor = null;
touchDownTarget = null;
return false;
else {
this.event = event;
actor = event.getListenerActor();
detector.touchUp(event.getStageX(), event.getStageY(), event.getPointer(), event.getButton());
actor.stageToLocalCoordinates(tmpCoords.set(event.getStageX(), event.getStageY()));
touchUp(event, tmpCoords.x, tmpCoords.y, event.getPointer(), event.getButton());
}
this.event = event;
actor = event.getListenerActor();
detector.touchUp(event.getStageX(), event.getStageY(), event.getPointer(), event.getButton());
actor.stageToLocalCoordinates(tmpCoords.set(event.getStageX(), event.getStageY()));
touchUp(event, tmpCoords.x, tmpCoords.y, event.getPointer(), event.getButton());
this.event = null;
actor = null;
touchDownTarget = null;
return true;
return !touchFocusCancel;
case touchDragged:
this.event = event;
actor = event.getListenerActor();
Expand Down Expand Up @@ -174,7 +174,6 @@ public GestureDetector getGestureDetector () {
return detector;
}

/** Returns null if there is no current touch down. */
public @Null Actor getTouchDownTarget () {
return touchDownTarget;
}
Expand Down

0 comments on commit e31c43a

Please sign in to comment.