diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2020-12-03 14:49:23 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-03 14:49:23 +0100 |
commit | d7460bb3044c57eb9f3233492446142fccf05eb4 (patch) | |
tree | e5a57962f21704c5c4d88c2a38187f5520bf70bc | |
parent | ee6d6b56afffe33c7ad73beb4556b6890a1831ff (diff) | |
parent | 7fa803fa2cc19a4a1a8600b88669a1ef02a30667 (diff) |
Merge pull request #44067 from akien-mga/fix_android_wrong_multitouch_pointerid
fix android wrong multi-touch pointerid
-rw-r--r-- | platform/android/java/lib/src/org/godotengine/godot/input/GodotInputHandler.java | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/platform/android/java/lib/src/org/godotengine/godot/input/GodotInputHandler.java b/platform/android/java/lib/src/org/godotengine/godot/input/GodotInputHandler.java index f3e985f944..6d5be312f1 100644 --- a/platform/android/java/lib/src/org/godotengine/godot/input/GodotInputHandler.java +++ b/platform/android/java/lib/src/org/godotengine/godot/input/GodotInputHandler.java @@ -181,6 +181,7 @@ public class GodotInputHandler implements InputDeviceListener { arr[i * 3 + 2] = event.getY(i); } final int action = event.getActionMasked(); + final int pointer_idx = event.getPointerId(event.getActionIndex()); mRenderView.queueOnRenderThread(new Runnable() { @Override @@ -189,12 +190,9 @@ public class GodotInputHandler implements InputDeviceListener { case MotionEvent.ACTION_DOWN: case MotionEvent.ACTION_CANCEL: case MotionEvent.ACTION_UP: - case MotionEvent.ACTION_MOVE: { - GodotLib.touch(event.getSource(), action, 0, evcount, arr); - } break; + case MotionEvent.ACTION_MOVE: case MotionEvent.ACTION_POINTER_UP: case MotionEvent.ACTION_POINTER_DOWN: { - int pointer_idx = event.getPointerId(event.getActionIndex()); GodotLib.touch(event.getSource(), action, pointer_idx, evcount, arr); } break; } |