Skip to content

Commit

Permalink
Merge pull request #84 from yunsash/pointer_index_fix
Browse files Browse the repository at this point in the history
game_activity: Fix `pointer_index()` always returning `0`
  • Loading branch information
rib authored May 24, 2023
2 parents 6559dc8 + 049e660 commit 924e540
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion android-activity/src/game_activity/input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 924e540

Please sign in to comment.