From ea4267ef2d08e429a938963dc33c067dac0fb3ce Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Thu, 3 Aug 2023 15:24:11 +0200 Subject: [PATCH] source/Platform/Win32/Win32Display.cpp: Use calculateSize() in setSize() --- source/Platform/Win32/Win32Display.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/source/Platform/Win32/Win32Display.cpp b/source/Platform/Win32/Win32Display.cpp index eeecffe..78f4be0 100644 --- a/source/Platform/Win32/Win32Display.cpp +++ b/source/Platform/Win32/Win32Display.cpp @@ -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