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:
laurentgom 2009-02-14 11:13:33 +00:00
parent dd5b22b872
commit ebdee32601

View File

@ -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);
} }