summaryrefslogtreecommitdiff
path: root/platform/osx/src/MGLMapView.mm
diff options
context:
space:
mode:
authorMinh Nguyễn <mxn@1ec5.org>2016-05-09 13:11:03 -0700
committerMinh Nguyễn <mxn@1ec5.org>2016-05-09 13:11:03 -0700
commite4d32b5cbef17fc5dd97d54a84e2cca2dfc002dc (patch)
tree76c5164d846202a9d5f7a4fe3cfe8640427224e2 /platform/osx/src/MGLMapView.mm
parent5d2929ed0eaecdafe4dcfe097ebffaae8b1b8d53 (diff)
downloadqtlocation-mapboxgl-e4d32b5cbef17fc5dd97d54a84e2cca2dfc002dc.tar.gz
[osx] Removed two-finger tap zoom-out gesture
As in MapKit, a two-finger tap should be interpreted as a secondary click to open the context menu, if applicable. It should not zoom out; rather, a double-tap on a mouse should zoom out (“smart magnification”).
Diffstat (limited to 'platform/osx/src/MGLMapView.mm')
-rw-r--r--platform/osx/src/MGLMapView.mm17
1 files changed, 1 insertions, 16 deletions
diff --git a/platform/osx/src/MGLMapView.mm b/platform/osx/src/MGLMapView.mm
index e06086cf35..d1356c6b49 100644
--- a/platform/osx/src/MGLMapView.mm
+++ b/platform/osx/src/MGLMapView.mm
@@ -394,10 +394,6 @@ public:
clickGestureRecognizer.delaysPrimaryMouseButtonEvents = NO;
[self addGestureRecognizer:clickGestureRecognizer];
- NSClickGestureRecognizer *secondaryClickGestureRecognizer = [[NSClickGestureRecognizer alloc] initWithTarget:self action:@selector(handleSecondaryClickGesture:)];
- secondaryClickGestureRecognizer.buttonMask = 0x2;
- [self addGestureRecognizer:secondaryClickGestureRecognizer];
-
NSClickGestureRecognizer *doubleClickGestureRecognizer = [[NSClickGestureRecognizer alloc] initWithTarget:self action:@selector(handleDoubleClickGesture:)];
doubleClickGestureRecognizer.numberOfClicksRequired = 2;
doubleClickGestureRecognizer.delaysPrimaryMouseButtonEvents = NO;
@@ -1362,18 +1358,6 @@ public:
}
}
-/// Tap with two fingers (“right-click”) to zoom out.
-- (void)handleSecondaryClickGesture:(NSClickGestureRecognizer *)gestureRecognizer {
- if (!self.zoomEnabled || gestureRecognizer.state != NSGestureRecognizerStateEnded) {
- return;
- }
-
- _mbglMap->cancelTransitions();
-
- NSPoint gesturePoint = [gestureRecognizer locationInView:self];
- [self scaleBy:0.5 atPoint:gesturePoint animated:YES];
-}
-
/// Double-click or double-tap to zoom in.
- (void)handleDoubleClickGesture:(NSClickGestureRecognizer *)gestureRecognizer {
if (!self.zoomEnabled || gestureRecognizer.state != NSGestureRecognizerStateEnded
@@ -1394,6 +1378,7 @@ public:
_mbglMap->cancelTransitions();
+ // Tap with two fingers (“right-click”) to zoom out on mice but not trackpads.
NSPoint gesturePoint = [self convertPoint:event.locationInWindow fromView:nil];
[self scaleBy:0.5 atPoint:gesturePoint animated:YES];
}