summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Wray <jason@mapbox.com>2019-06-19 15:48:26 -0700
committerJason Wray <jason@mapbox.com>2019-06-19 16:07:20 -0700
commiteb88c6f84e44cac3af4082ab05a0ec0e89dc223c (patch)
tree6c84da4debb191183d953cf54270a4dbefa4750c
parent555f3e04af473d7b3a3bcd6ce443d0c2e290c4ca (diff)
downloadqtlocation-mapboxgl-upstream/friedbunny-makes-sure-tilt-gestures-stay-two-fingered-or-else.tar.gz
-rw-r--r--platform/ios/src/MGLMapView.mm8
1 files changed, 6 insertions, 2 deletions
diff --git a/platform/ios/src/MGLMapView.mm b/platform/ios/src/MGLMapView.mm
index 8f34e80083..9693e3cff9 100644
--- a/platform/ios/src/MGLMapView.mm
+++ b/platform/ios/src/MGLMapView.mm
@@ -2049,8 +2049,6 @@ public:
{
if ( ! self.isPitchEnabled) return;
- if (twoFingerDrag.numberOfTouches != 2) return;
-
[self cancelTransitions];
self.cameraChangeReasonBitmask |= MGLCameraChangeReasonGestureTilt;
@@ -2064,6 +2062,12 @@ public:
if (twoFingerDrag.state == UIGestureRecognizerStateBegan || twoFingerDrag.state == UIGestureRecognizerStateChanged)
{
+ if (twoFingerDrag.numberOfTouches != 2)
+ {
+ twoFingerDrag.state = UIGestureRecognizerStateEnded;
+ return;
+ }
+
CGFloat gestureDistance = CGPoint([twoFingerDrag translationInView:twoFingerDrag.view]).y;
CGFloat slowdown = 2.0;