瀏覽代碼

fix android wrong multi-touch pointerid

alan-w-255 4 年之前
父節點
當前提交
cbda02991f
共有 1 個文件被更改,包括 2 次插入4 次删除
  1. 2 4
      platform/android/java/lib/src/org/godotengine/godot/input/GodotInputHandler.java

+ 2 - 4
platform/android/java/lib/src/org/godotengine/godot/input/GodotInputHandler.java

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