mirror of
https://github.com/glfw/glfw.git
synced 2024-11-22 04:54:35 +00:00
Formatting.
This commit is contained in:
parent
058acc7f22
commit
0221b5c279
@ -917,15 +917,15 @@ void _glfwPlatformSetMouseCursorPos(_GLFWwindow* window, int x, int y)
|
|||||||
// Without this (once per app run, but it's convenient to do it here)
|
// Without this (once per app run, but it's convenient to do it here)
|
||||||
// events will be suppressed for a default of 0.25 seconds after we
|
// events will be suppressed for a default of 0.25 seconds after we
|
||||||
// move the cursor.
|
// move the cursor.
|
||||||
CGSetLocalEventsSuppressionInterval( 0.0 );
|
CGSetLocalEventsSuppressionInterval(0.0);
|
||||||
|
|
||||||
NSPoint localPoint = NSMakePoint( x, y );
|
NSPoint localPoint = NSMakePoint(x, y);
|
||||||
NSPoint globalPoint = [window->NS.window convertBaseToScreen:localPoint];
|
NSPoint globalPoint = [window->NS.window convertBaseToScreen:localPoint];
|
||||||
CGPoint mainScreenOrigin = CGDisplayBounds( CGMainDisplayID() ).origin;
|
CGPoint mainScreenOrigin = CGDisplayBounds(CGMainDisplayID()).origin;
|
||||||
double mainScreenHeight = CGDisplayBounds( CGMainDisplayID() ).size.height;
|
double mainScreenHeight = CGDisplayBounds(CGMainDisplayID()).size.height;
|
||||||
CGPoint targetPoint = CGPointMake( globalPoint.x - mainScreenOrigin.x,
|
CGPoint targetPoint = CGPointMake(globalPoint.x - mainScreenOrigin.x,
|
||||||
mainScreenHeight - globalPoint.y -
|
mainScreenHeight - globalPoint.y -
|
||||||
mainScreenOrigin.y );
|
mainScreenOrigin.y);
|
||||||
CGDisplayMoveCursorToPoint( CGMainDisplayID(), targetPoint );
|
CGDisplayMoveCursorToPoint(CGMainDisplayID(), targetPoint);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user