diff options
author | bjarni <bjarni@openttd.org> | 2007-07-02 16:37:12 +0000 |
---|---|---|
committer | bjarni <bjarni@openttd.org> | 2007-07-02 16:37:12 +0000 |
commit | 6574e622f7b4662f8f1095e6ba120b84605ca1d6 (patch) | |
tree | fc9700e8f01970a93973ddf32af4b6a93a58977b /src/video/cocoa_v.mm | |
parent | ec137f60edec89392a19fc078bf47d2ee291dc1c (diff) | |
download | openttd-6574e622f7b4662f8f1095e6ba120b84605ca1d6.tar.xz |
(svn r10410) -Fix [FS458]: [OSX] if the resolution is changed to something that's too high for the monitor, then it's reduced to fit the monitor size (PinguTux)
This solves a possible crash
This also solves a graphical glitch where the titlebar can be drawn on top of the game area
Those issues only aplied to window mode
Diffstat (limited to 'src/video/cocoa_v.mm')
-rw-r--r-- | src/video/cocoa_v.mm | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/video/cocoa_v.mm b/src/video/cocoa_v.mm index 1481bc606..debbc2f53 100644 --- a/src/video/cocoa_v.mm +++ b/src/video/cocoa_v.mm @@ -1184,10 +1184,17 @@ static const char* QZ_SetVideoWindowed(uint width, uint height) /* We already have a window, just change its size */ if (!isCustom) { [ _cocoa_video_data.window setContentSize:contentRect.size ]; + // Ensure frame height - title bar height >= view height + contentRect.size.height = clamp(height, 0, [ _cocoa_video_data.window frame ].size.height - 22 /* 22 is the height of title bar of window*/); + height = contentRect.size.height; [ _cocoa_video_data.qdview setFrameSize:contentRect.size ]; } } + // Update again + _cocoa_video_data.width = width; + _cocoa_video_data.height = height; + [ _cocoa_video_data.window center ]; /* Only recreate the view if it doesn't already exist */ |