| 997 | } |
| 998 | |
| 999 | void MacWindow::SetClientBounds(const Rectangle& clientArea) |
| 1000 | { |
| 1001 | NSWindow* window = (NSWindow*)_window; |
| 1002 | if (!window) |
| 1003 | return; |
| 1004 | const float screenScale = MacPlatform::ScreenScale; |
| 1005 | |
| 1006 | NSRect oldRect = [window frame]; |
| 1007 | NSRect newRect = NSMakeRect(0, 0, clientArea.Size.X / screenScale, clientArea.Size.Y / screenScale); |
| 1008 | newRect = [window frameRectForContentRect:newRect]; |
| 1009 | |
| 1010 | Float2 pos = AppleUtils::PosToCoca(clientArea.Location) / screenScale; |
| 1011 | Float2 titleSize = GetWindowTitleSize(this); |
| 1012 | newRect.origin.x = pos.X + titleSize.X; |
| 1013 | newRect.origin.y = pos.Y - newRect.size.height + titleSize.Y; |
| 1014 | |
| 1015 | [window setFrame:newRect display:YES]; |
| 1016 | } |
| 1017 | |
| 1018 | void MacWindow::SetPosition(const Float2& position) |
| 1019 | { |
nothing calls this directly
no test coverage detected