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

Commit

Permalink
[ios] Require two fingers for duration of tilt gesture
Browse files Browse the repository at this point in the history
  • Loading branch information
friedbunny authored Jun 20, 2019
1 parent 6aa065c commit b98dbd2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions platform/ios/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

Mapbox welcomes participation and contributions from everyone. Please read [CONTRIBUTING.md](../../CONTRIBUTING.md) to get started.

## 5.2.0

* Fixed an issue where the two-finger tilt gesture would continue after lifting one finger. ([#14969](https://github.com/mapbox/mapbox-gl-native/pull/14969))

## 5.1.0 - June 19, 2019

### Styles and rendering
Expand Down
6 changes: 6 additions & 0 deletions platform/ios/src/MGLMapView.mm
Original file line number Diff line number Diff line change
Expand Up @@ -2062,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 b98dbd2

Please sign in to comment.