From 049e6602199e27a81bddf28c209a3e028efee907 Mon Sep 17 00:00:00 2001 From: kukie Date: Tue, 23 May 2023 15:43:03 +0300 Subject: [PATCH] fix: pointer_index always returns 0 --- android-activity/src/game_activity/input.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android-activity/src/game_activity/input.rs b/android-activity/src/game_activity/input.rs index ac951be..0f29a42 100644 --- a/android-activity/src/game_activity/input.rs +++ b/android-activity/src/game_activity/input.rs @@ -332,7 +332,7 @@ impl<'a> MotionEvent<'a> { /// or [`PointerDown`](MotionAction::PointerDown). #[inline] pub fn pointer_index(&self) -> usize { - let action = self.action as u32 & ndk_sys::AMOTION_EVENT_ACTION_MASK; + let action = self.action as u32; let index = (action & ndk_sys::AMOTION_EVENT_ACTION_POINTER_INDEX_MASK) >> ndk_sys::AMOTION_EVENT_ACTION_POINTER_INDEX_SHIFT; index as usize