mirror of
https://github.com/rust-mobile/android-activity.git
synced 2026-07-11 00:58:54 +00:00
fix: pointer_index always returns 0
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user