mirror of
https://github.com/SFML/SFML.git
synced 2024-11-25 04:41:05 +08:00
Fixed Window::SetSize not resizing to the requested size, on Windows
git-svn-id: https://sfml.svn.sourceforge.net/svnroot/sfml/trunk@1016 4e206d99-4929-0410-ac5d-dfc041789085
This commit is contained in:
parent
dd5b22b872
commit
ebdee32601
@ -355,6 +355,13 @@ void WindowImplWin32::SetPosition(int Left, int Top)
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
void WindowImplWin32::SetSize(unsigned int Width, unsigned int Height)
|
void WindowImplWin32::SetSize(unsigned int Width, unsigned int Height)
|
||||||
{
|
{
|
||||||
|
// SetWindowPos wants the total size of the window (including title bar and borders),
|
||||||
|
// so we have to compute it
|
||||||
|
RECT Rect = {0, 0, Width, Height};
|
||||||
|
AdjustWindowRect(&Rect, GetWindowLong(myHandle, GWL_STYLE), false);
|
||||||
|
Width = Rect.right - Rect.left;
|
||||||
|
Height = Rect.bottom - Rect.top;
|
||||||
|
|
||||||
SetWindowPos(myHandle, NULL, 0, 0, Width, Height, SWP_NOMOVE | SWP_NOZORDER);
|
SetWindowPos(myHandle, NULL, 0, 0, Width, Height, SWP_NOMOVE | SWP_NOZORDER);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user