MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / SetClientBounds

Method SetClientBounds

Source/Engine/Platform/Mac/MacWindow.cpp:999–1016  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

997}
998
999void 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
1018void MacWindow::SetPosition(const Float2& position)
1019{

Callers

nothing calls this directly

Calls 1

GetWindowTitleSizeFunction · 0.85

Tested by

no test coverage detected