mirror of
https://port.numenaute.org/aleajactaest/khanat-code-old.git
synced 2024-11-10 09:19:01 +00:00
Changed: #947 window position and cocoa screen coordinates
This commit is contained in:
parent
ec0e4bc2c1
commit
089014147d
1 changed files with 8 additions and 13 deletions
|
@ -126,23 +126,18 @@ void getWindowSize(uint32 &width, uint32 &height)
|
||||||
|
|
||||||
void getWindowPos(uint32 &x, uint32 &y)
|
void getWindowPos(uint32 &x, uint32 &y)
|
||||||
{
|
{
|
||||||
/*
|
NSRect screenRect = [[g_window screen] frame];
|
||||||
TODO mac os gives bottom left
|
NSRect windowRect = [g_window frame];
|
||||||
*/
|
x = windowRect.origin.x;
|
||||||
|
y = screenRect.size.height - windowRect.size.height - windowRect.origin.y;
|
||||||
NSRect rect = [g_window frame];
|
|
||||||
x = rect.origin.x;
|
|
||||||
y = rect.origin.y;
|
|
||||||
|
|
||||||
nldebug("%d %d", x, y);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void setWindowPos(uint32 x, uint32 y)
|
void setWindowPos(uint32 x, uint32 y)
|
||||||
{
|
{
|
||||||
/*
|
NSRect screenRect = [[g_window screen] frame];
|
||||||
TODO mac os gets bottom left
|
NSRect windowRect = [g_window frame];
|
||||||
*/
|
y = screenRect.size.height - y;
|
||||||
[g_window setFrameOrigin:NSMakePoint(x, y)];
|
[g_window setFrameTopLeftPoint:NSMakePoint(x, y)];
|
||||||
}
|
}
|
||||||
|
|
||||||
void setWindowTitle(const ucstring &title)
|
void setWindowTitle(const ucstring &title)
|
||||||
|
|
Loading…
Reference in a new issue