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

Commit

Permalink
[macos] Fixed cursor shifting after drag gesture
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
1ec5 committed Jun 29, 2017
1 parent f34ea8b commit bd9b873
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions platform/macos/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion platform/macos/src/MGLMapView.mm
Original file line number Diff line number Diff line change
Expand Up @@ -1369,7 +1369,7 @@ - (void)handlePanGesture:(NSPanGestureRecognizer *)gestureRecognizer {
// 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);
Expand Down

0 comments on commit bd9b873

Please sign in to comment.