From 3be8984c630856e27afa3b98300855a2af774e58 Mon Sep 17 00:00:00 2001 From: iProgramInCpp Date: Fri, 3 Nov 2023 19:30:22 +0200 Subject: [PATCH] * Android: Fix bug where pointer IDs were used incorrectly. --- platforms/android/main.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/platforms/android/main.cpp b/platforms/android/main.cpp index f7ef7e5..09d6a8f 100644 --- a/platforms/android/main.cpp +++ b/platforms/android/main.cpp @@ -171,10 +171,11 @@ static int32_t evalMotionInput(struct engine* engine, AInputEvent* event, int32_ int actionp = AMotionEvent_getAction(event); int action = actionp & AMOTION_EVENT_ACTION_MASK; - int pointerId = AMotionEvent_getPointerId(event, (actionp & AMOTION_EVENT_ACTION_POINTER_INDEX_MASK) >> AMOTION_EVENT_ACTION_POINTER_INDEX_SHIFT); + int pointerIndex = (actionp & AMOTION_EVENT_ACTION_POINTER_INDEX_MASK) >> AMOTION_EVENT_ACTION_POINTER_INDEX_SHIFT; + int pointerId = AMotionEvent_getPointerId(event, pointerIndex); - int x = AMotionEvent_getX(event, pointerId); - int y = AMotionEvent_getY(event, pointerId); + int x = AMotionEvent_getX(event, pointerIndex); + int y = AMotionEvent_getY(event, pointerIndex); switch (action) {