1
0
Fork 0

source/Platform/Win32/Win32Display.cpp: Use calculateSize() in setSize()

This commit is contained in:
Henrik Hautakoski 2023-08-03 15:24:11 +02:00
parent 80591ff6ee
commit ea4267ef2d

View file

@ -91,14 +91,8 @@ bool Win32Display::isValid()
void Win32Display::setSize(unsigned int width, unsigned int height)
{
int w, h;
RECT rect = {0, 0, (LONG) width, (LONG) height};
AdjustWindowRect(&rect, GetWindowLong(m_handle, GWL_STYLE), false);
w = rect.right - rect.left;
h = rect.bottom - rect.top;
::SetWindowPos(m_handle, NULL, 0, 0, w, h, SWP_NOMOVE | SWP_NOZORDER);
Vector2i s = calculateSize(GetWindowLong(m_handle, GWL_STYLE), width, height);
::SetWindowPos(m_handle, NULL, 0, 0, s.x, s.y, SWP_NOMOVE | SWP_NOZORDER);
}
Vector2u Win32Display::getSize() const