Skip to content

Commit

Permalink
InputService: ensure mIsButtonOneDown is always set (#48)
Browse files Browse the repository at this point in the history
...regardless of exceptions being thrown by the gesture functions.

These would throw when the maximum gesture duration of 1 minute would be
reached.

Thanks to https://github.com/redburn82 for pointing this out!

Closes #38, closes #46
  • Loading branch information
bk138 authored Nov 2, 2021
1 parent 116a3d5 commit 1005f88
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ public static void onPointerEvent(int buttonMask, int x, int y, long client) {

// down, was up
if ((buttonMask & (1 << 0)) != 0 && !instance.mIsButtonOneDown) {
instance.startGesture(x, y);
instance.mIsButtonOneDown = true;
instance.startGesture(x, y);
}

// down, was down
Expand All @@ -130,8 +130,8 @@ public static void onPointerEvent(int buttonMask, int x, int y, long client) {

// up, was down
if ((buttonMask & (1 << 0)) == 0 && instance.mIsButtonOneDown) {
instance.endGesture(x, y);
instance.mIsButtonOneDown = false;
instance.endGesture(x, y);
}


Expand Down

0 comments on commit 1005f88

Please sign in to comment.