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

Reverse and quicken quickzoom gesture #2153

Merged
merged 3 commits into from
Sep 25, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions platform/ios/MGLMapView.mm
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,8 @@ - (void)commonInit
{
_quickZoom = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(handleQuickZoomGesture:)];
_quickZoom.numberOfTapsRequired = 1;
_quickZoom.minimumPressDuration = 0.25;
_quickZoom.minimumPressDuration = 0;
[_quickZoom requireGestureRecognizerToFail:doubleTap];
[self addGestureRecognizer:_quickZoom];
}

Expand Down Expand Up @@ -1336,9 +1337,9 @@ - (void)handleQuickZoomGesture:(UILongPressGestureRecognizer *)quickZoom
}
else if (quickZoom.state == UIGestureRecognizerStateChanged)
{
CGFloat distance = self.quickZoomStart - [quickZoom locationInView:quickZoom.view].y;
CGFloat distance = [quickZoom locationInView:quickZoom.view].y - self.quickZoomStart;

CGFloat newZoom = log2f(self.scale) + (distance / 100);
CGFloat newZoom = log2f(self.scale) + (distance / 75);

if (newZoom < _mbglMap->getMinZoom()) return;

Expand Down