Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Make Android port compatible with older API versions again.
Browse files Browse the repository at this point in the history
Fixes Bugzilla #1563.

Thanks to Philipp Wiesemann for the patch!
  • Loading branch information
icculus committed Aug 4, 2012
1 parent 5af791c commit 4e5fb6c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions android-project/src/org/libsdl/app/SDLActivity.java
Expand Up @@ -539,9 +539,9 @@ public boolean onTouch(View v, MotionEvent event) {
final int touchDevId = event.getDeviceId();
final int pointerCount = event.getPointerCount();
// touchId, pointerId, action, x, y, pressure
int actionPointerIndex = event.getActionIndex();
int actionPointerIndex = (event.getAction() & MotionEvent.ACTION_POINTER_ID_MASK) >> MotionEvent. ACTION_POINTER_ID_SHIFT; /* API 8: event.getActionIndex(); */
int pointerFingerId = event.getPointerId(actionPointerIndex);
int action = event.getActionMasked();
int action = (event.getAction() & MotionEvent.ACTION_MASK); /* API 8: event.getActionMasked(); */

float x = event.getX(actionPointerIndex);
float y = event.getY(actionPointerIndex);
Expand Down

0 comments on commit 4e5fb6c

Please sign in to comment.