[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.
This commit is contained in:
committed by
Minh Nguyễn
parent
ae7dc8ce48
commit
92157762cf
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user