fix: pointer_index always returns 0

This commit is contained in:
kukie
2023-05-23 15:43:03 +03:00
parent 6559dc8133
commit 049e660219
+1 -1
View File
@@ -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