1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-06 12:20:30 +00:00

fix android wrong multi-touch pointerid

This commit is contained in:
alan-w-255
2020-11-27 15:45:07 +08:00
parent 803f6d2388
commit cbda02991f

View File

@@ -182,6 +182,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());
godotView.queueEvent(new Runnable() { godotView.queueEvent(new Runnable() {
@Override @Override
@@ -190,12 +191,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;
} }