Merge pull request #44067 from akien-mga/fix_android_wrong_multitouch_pointerid

fix android wrong multi-touch pointerid
This commit is contained in:
Rémi Verschelde 2020-12-03 14:49:23 +01:00 committed by GitHub
commit d7460bb304
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -181,6 +181,7 @@ public class GodotInputHandler implements InputDeviceListener {
arr[i * 3 + 2] = event.getY(i); arr[i * 3 + 2] = event.getY(i);
} }
final int action = event.getActionMasked(); final int action = event.getActionMasked();
final int pointer_idx = event.getPointerId(event.getActionIndex());
mRenderView.queueOnRenderThread(new Runnable() { mRenderView.queueOnRenderThread(new Runnable() {
@Override @Override
@ -189,12 +190,9 @@ public class GodotInputHandler implements InputDeviceListener {
case MotionEvent.ACTION_DOWN: case MotionEvent.ACTION_DOWN:
case MotionEvent.ACTION_CANCEL: case MotionEvent.ACTION_CANCEL:
case MotionEvent.ACTION_UP: case MotionEvent.ACTION_UP:
case MotionEvent.ACTION_MOVE: { case MotionEvent.ACTION_MOVE:
GodotLib.touch(event.getSource(), action, 0, evcount, arr);
} break;
case MotionEvent.ACTION_POINTER_UP: case MotionEvent.ACTION_POINTER_UP:
case MotionEvent.ACTION_POINTER_DOWN: { case MotionEvent.ACTION_POINTER_DOWN: {
int pointer_idx = event.getPointerId(event.getActionIndex());
GodotLib.touch(event.getSource(), action, pointer_idx, evcount, arr); GodotLib.touch(event.getSource(), action, pointer_idx, evcount, arr);
} break; } break;
} }