From 8f447658311451985951157ac6284f0b36e4d9d0 Mon Sep 17 00:00:00 2001 From: Fredia Huya-Kouadio Date: Sat, 10 Jun 2023 08:52:26 -0700 Subject: [PATCH] Fix spatial viewport multitouch detection support Regression introduced by https://github.com/godotengine/godot/pull/77497 --- .../src/org/godotengine/godot/input/GodotGestureHandler.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/platform/android/java/lib/src/org/godotengine/godot/input/GodotGestureHandler.kt b/platform/android/java/lib/src/org/godotengine/godot/input/GodotGestureHandler.kt index ad28ed9c37a8..852195feb99a 100644 --- a/platform/android/java/lib/src/org/godotengine/godot/input/GodotGestureHandler.kt +++ b/platform/android/java/lib/src/org/godotengine/godot/input/GodotGestureHandler.kt @@ -228,7 +228,7 @@ internal class GodotGestureHandler : SimpleOnGestureListener(), OnScaleGestureLi val x = terminusEvent.x val y = terminusEvent.y - if (terminusEvent.pointerCount >= 2 && panningAndScalingEnabled && !pointerCaptureInProgress) { + if (terminusEvent.pointerCount >= 2 && panningAndScalingEnabled && !pointerCaptureInProgress && !dragInProgress) { GodotLib.pan(x, y, distanceX / 5f, distanceY / 5f) } else if (!scaleInProgress) { dragInProgress = true @@ -238,7 +238,7 @@ internal class GodotGestureHandler : SimpleOnGestureListener(), OnScaleGestureLi } override fun onScale(detector: ScaleGestureDetector): Boolean { - if (!panningAndScalingEnabled || pointerCaptureInProgress) { + if (!panningAndScalingEnabled || pointerCaptureInProgress || dragInProgress) { return false } @@ -253,7 +253,7 @@ internal class GodotGestureHandler : SimpleOnGestureListener(), OnScaleGestureLi } override fun onScaleBegin(detector: ScaleGestureDetector): Boolean { - if (!panningAndScalingEnabled || pointerCaptureInProgress) { + if (!panningAndScalingEnabled || pointerCaptureInProgress || dragInProgress) { return false } scaleInProgress = true