diff options
author | Minh Nguyễn <mxn@1ec5.org> | 2017-06-28 22:47:30 -0700 |
---|---|---|
committer | Minh Nguyễn <mxn@1ec5.org> | 2017-06-29 10:10:31 -0700 |
commit | 92157762cf501c9b96de2d1c6d384cb8633c554b (patch) | |
tree | 8c94312e0957bb6409d41705c2dacdb5d683012f /platform | |
parent | ae7dc8ce48d7923a41abb79b4bd0b895e74196fe (diff) | |
download | qtlocation-mapboxgl-92157762cf501c9b96de2d1c6d384cb8633c554b.tar.gz |
[macos] Fixed cursor shifting after drag gesture
When redisplaying the mouse cursor after a modified drag gesture, incorporate the conversion from view coordinates to window coordinates. Previously, this code performed the conversion but threw away the results.
Fixes #8670.
Diffstat (limited to 'platform')
-rw-r--r-- | platform/macos/CHANGELOG.md | 1 | ||||
-rw-r--r-- | platform/macos/src/MGLMapView.mm | 2 |
2 files changed, 2 insertions, 1 deletions
diff --git a/platform/macos/CHANGELOG.md b/platform/macos/CHANGELOG.md index ace533e01f..f69f7e1b5d 100644 --- a/platform/macos/CHANGELOG.md +++ b/platform/macos/CHANGELOG.md @@ -33,6 +33,7 @@ This version of the Mapbox macOS SDK corresponds to version 3.6.0 of the Mapbox ### User interaction * Fixed an issue causing the map to go blank during a flight animation that travels a very short distance. ([#9199](https://github.com/mapbox/mapbox-gl-native/pull/9199)) +* Fixed an issue causing the mouse cursor to jump after Shift- or Option-dragging the map. ([#9390](https://github.com/mapbox/mapbox-gl-native/pull/9390)) * The Improve This Map button in the attribution action sheet now leads to a feedback tool that matches MGLMapView’s rotation and pitch. `-[MGLAttributionInfo feedbackURLAtCenterCoordinate:zoomLevel:]` no longer respects the feedback URL specified in TileJSON. ([#9078](https://github.com/mapbox/mapbox-gl-native/pull/9078)) ### Other changes diff --git a/platform/macos/src/MGLMapView.mm b/platform/macos/src/MGLMapView.mm index 3e91a6c5a5..1908a46cf9 100644 --- a/platform/macos/src/MGLMapView.mm +++ b/platform/macos/src/MGLMapView.mm @@ -1369,7 +1369,7 @@ public: // Move the cursor back to the start point and show it again, creating // the illusion that it has stayed in place during the entire gesture. CGPoint cursorPoint = [self convertPoint:startPoint toView:nil]; - cursorPoint = [self.window convertRectToScreen:{ startPoint, NSZeroSize }].origin; + cursorPoint = [self.window convertRectToScreen:{ cursorPoint, NSZeroSize }].origin; cursorPoint.y = self.window.screen.frame.size.height - cursorPoint.y; CGDisplayMoveCursorToPoint(kCGDirectMainDisplay, cursorPoint); CGDisplayShowCursor(kCGDirectMainDisplay); |