Skip to content

Commit

Permalink
Merge pull request #78083 from m4gr3d/fix_multitouch_detection_spatia…
Browse files Browse the repository at this point in the history
…l_viewport_main

Fix spatial viewport multitouch detection support
  • Loading branch information
m4gr3d authored Jun 12, 2023
2 parents 37d1dfe + 2c050cc commit dcd31a2
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,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
Expand All @@ -241,7 +241,7 @@ internal class GodotGestureHandler : SimpleOnGestureListener(), OnScaleGestureLi
}

override fun onScale(detector: ScaleGestureDetector): Boolean {
if (!panningAndScalingEnabled || pointerCaptureInProgress) {
if (!panningAndScalingEnabled || pointerCaptureInProgress || dragInProgress) {
return false
}

Expand All @@ -256,7 +256,7 @@ internal class GodotGestureHandler : SimpleOnGestureListener(), OnScaleGestureLi
}

override fun onScaleBegin(detector: ScaleGestureDetector): Boolean {
if (!panningAndScalingEnabled || pointerCaptureInProgress) {
if (!panningAndScalingEnabled || pointerCaptureInProgress || dragInProgress) {
return false
}
scaleInProgress = true
Expand Down

0 comments on commit dcd31a2

Please sign in to comment.