diff options
author | Jason Wray <jason@mapbox.com> | 2019-06-19 15:48:26 -0700 |
---|---|---|
committer | Jason Wray <jason@mapbox.com> | 2019-06-19 16:07:20 -0700 |
commit | eb88c6f84e44cac3af4082ab05a0ec0e89dc223c (patch) | |
tree | 6c84da4debb191183d953cf54270a4dbefa4750c | |
parent | 555f3e04af473d7b3a3bcd6ce443d0c2e290c4ca (diff) | |
download | qtlocation-mapboxgl-upstream/friedbunny-makes-sure-tilt-gestures-stay-two-fingered-or-else.tar.gz |
End gesture, don't return indefinitelyupstream/friedbunny-makes-sure-tilt-gestures-stay-two-fingered-or-else
-rw-r--r-- | platform/ios/src/MGLMapView.mm | 8 |
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; |