Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
End gesture, don't return indefinitely
Browse files Browse the repository at this point in the history
  • Loading branch information
friedbunny committed Jun 19, 2019
1 parent 555f3e0 commit eb88c6f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions platform/ios/src/MGLMapView.mm
Original file line number Diff line number Diff line change
Expand Up @@ -2049,8 +2049,6 @@ - (void)handleTwoFingerDragGesture:(UIPanGestureRecognizer *)twoFingerDrag
{
if ( ! self.isPitchEnabled) return;

if (twoFingerDrag.numberOfTouches != 2) return;

[self cancelTransitions];

self.cameraChangeReasonBitmask |= MGLCameraChangeReasonGestureTilt;
Expand All @@ -2064,6 +2062,12 @@ - (void)handleTwoFingerDragGesture:(UIPanGestureRecognizer *)twoFingerDrag

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;

Expand Down

0 comments on commit eb88c6f

Please sign in to comment.