Merged fix for bug #3528964.
This commit is contained in:
parent
cef9dea1d2
commit
ee66e5fa10
@ -917,7 +917,7 @@ their skills. Special thanks go out to:</p>
|
|||||||
|
|
||||||
<li>Steve Sexton, for reporting an input bug in the Carbon port</li>
|
<li>Steve Sexton, for reporting an input bug in the Carbon port</li>
|
||||||
|
|
||||||
<li>Dmitri Shuralyov, for support, bug reports and testing</li>
|
<li>Dmitri Shuralyov, for support, bug reports, bug fixes and testing</li>
|
||||||
|
|
||||||
<li>Daniel Skorupski, for reporting a bug in the Win32 DEF file</li>
|
<li>Daniel Skorupski, for reporting a bug in the Win32 DEF file</li>
|
||||||
|
|
||||||
|
@ -357,12 +357,13 @@ static int convertMacKeyCode(unsigned int macKeyCode)
|
|||||||
_glfwInputCursorMotion(window, [event deltaX], [event deltaY]);
|
_glfwInputCursorMotion(window, [event deltaX], [event deltaY]);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
NSPoint p = [event locationInWindow];
|
const NSPoint p = [event locationInWindow];
|
||||||
|
|
||||||
// Cocoa coordinate system has origin at lower left
|
// Cocoa coordinate system has origin at lower left
|
||||||
p.y = [[window->NS.object contentView] bounds].size.height - p.y;
|
const int x = lround(floor(p.x));
|
||||||
|
const int y = window->height - lround(ceil(p.y));
|
||||||
|
|
||||||
_glfwInputCursorMotion(window, p.x, p.y);
|
_glfwInputCursorMotion(window, x, y);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1168,7 +1169,7 @@ void _glfwPlatformSetCursorPos(_GLFWwindow* window, int x, int y)
|
|||||||
// calculating the maximum y coordinate of all screens, since Cocoa's
|
// calculating the maximum y coordinate of all screens, since Cocoa's
|
||||||
// "global coordinates" are upside down from CG's...
|
// "global coordinates" are upside down from CG's...
|
||||||
|
|
||||||
NSPoint localPoint = NSMakePoint(x, window->height - y);
|
NSPoint localPoint = NSMakePoint(x, window->height - y - 1);
|
||||||
NSPoint globalPoint = [window->NS.object convertBaseToScreen:localPoint];
|
NSPoint globalPoint = [window->NS.object convertBaseToScreen:localPoint];
|
||||||
CGPoint mainScreenOrigin = CGDisplayBounds(CGMainDisplayID()).origin;
|
CGPoint mainScreenOrigin = CGDisplayBounds(CGMainDisplayID()).origin;
|
||||||
double mainScreenHeight = CGDisplayBounds(CGMainDisplayID()).size.height;
|
double mainScreenHeight = CGDisplayBounds(CGMainDisplayID()).size.height;
|
||||||
|
Loading…
Reference in New Issue
Block a user