mirror of
https://github.com/glfw/glfw.git
synced 2024-11-22 13:04:35 +00:00
Cleanup.
This commit is contained in:
parent
2591b6c8c8
commit
89588a4508
@ -456,8 +456,7 @@ static int convertMacKeyCode(unsigned int macKeyCode)
|
|||||||
_glfwInputCursorMotion(window, [event deltaX], [event deltaY]);
|
_glfwInputCursorMotion(window, [event deltaX], [event deltaY]);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
const NSRect contentRect =
|
const NSRect contentRect = [window->ns.view frame];
|
||||||
[window->ns.object contentRectForFrameRect:[window->ns.object frame]];
|
|
||||||
const NSPoint p = [event locationInWindow];
|
const NSPoint p = [event locationInWindow];
|
||||||
|
|
||||||
_glfwInputCursorMotion(window, p.x, contentRect.size.height - p.y);
|
_glfwInputCursorMotion(window, p.x, contentRect.size.height - p.y);
|
||||||
@ -662,7 +661,7 @@ static NSString* findAppName(void)
|
|||||||
id name = [infoDictionary objectForKey:GLFWNameKeys[i]];
|
id name = [infoDictionary objectForKey:GLFWNameKeys[i]];
|
||||||
if (name &&
|
if (name &&
|
||||||
[name isKindOfClass:[NSString class]] &&
|
[name isKindOfClass:[NSString class]] &&
|
||||||
![@"" isEqualToString:name])
|
![name isEqualToString:@""])
|
||||||
{
|
{
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
@ -915,8 +914,7 @@ void _glfwPlatformSetWindowPos(_GLFWwindow* window, int x, int y)
|
|||||||
|
|
||||||
void _glfwPlatformGetWindowSize(_GLFWwindow* window, int* width, int* height)
|
void _glfwPlatformGetWindowSize(_GLFWwindow* window, int* width, int* height)
|
||||||
{
|
{
|
||||||
const NSRect contentRect =
|
const NSRect contentRect = [window->ns.view frame];
|
||||||
[window->ns.object contentRectForFrameRect:[window->ns.object frame]];
|
|
||||||
|
|
||||||
if (width)
|
if (width)
|
||||||
*width = contentRect.size.width;
|
*width = contentRect.size.width;
|
||||||
@ -995,8 +993,7 @@ void _glfwPlatformSetCursorPos(_GLFWwindow* window, double x, double y)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
const NSRect contentRect =
|
const NSRect contentRect = [window->ns.view frame];
|
||||||
[window->ns.object contentRectForFrameRect:[window->ns.object frame]];
|
|
||||||
const NSPoint localPoint = NSMakePoint(x, contentRect.size.height - y - 1);
|
const NSPoint localPoint = NSMakePoint(x, contentRect.size.height - y - 1);
|
||||||
const NSPoint globalPoint = [window->ns.object convertBaseToScreen:localPoint];
|
const NSPoint globalPoint = [window->ns.object convertBaseToScreen:localPoint];
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user