mirror of
https://github.com/SFML/SFML.git
synced 2024-11-25 12:51:05 +08:00
Improved resizing window on OS X (#474)
This commit is contained in:
parent
9b0ed300b5
commit
a66fe2721b
@ -339,6 +339,12 @@
|
|||||||
////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////
|
||||||
-(void)resizeTo:(unsigned int)width by:(unsigned int)height
|
-(void)resizeTo:(unsigned int)width by:(unsigned int)height
|
||||||
{
|
{
|
||||||
|
// Before resizing, remove resizeable mask to be able to resize
|
||||||
|
// beyond the desktop boundaries.
|
||||||
|
NSUInteger styleMask = [m_window styleMask];
|
||||||
|
|
||||||
|
[m_window setStyleMask:styleMask ^ NSResizableWindowMask];
|
||||||
|
|
||||||
// Add titlebar height.
|
// Add titlebar height.
|
||||||
NSRect frame = NSMakeRect([m_window frame].origin.x,
|
NSRect frame = NSMakeRect([m_window frame].origin.x,
|
||||||
[m_window frame].origin.y,
|
[m_window frame].origin.y,
|
||||||
@ -346,6 +352,9 @@
|
|||||||
height + [self titlebarHeight]);
|
height + [self titlebarHeight]);
|
||||||
|
|
||||||
[m_window setFrame:frame display:YES];
|
[m_window setFrame:frame display:YES];
|
||||||
|
|
||||||
|
// And restore the mask
|
||||||
|
[m_window setStyleMask:styleMask];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user