[UI] Windows AdjustWindowRect and GetClientRect usage cleanup

This commit is contained in:
Triang3l
2022-02-13 23:01:25 +03:00
parent be5f7db3ef
commit 7fc940422c
2 changed files with 49 additions and 38 deletions

View File

@@ -2,18 +2,13 @@
******************************************************************************
* Xenia : Xbox 360 Emulator Research Project *
******************************************************************************
* Copyright 2021 Ben Vanik. All rights reserved. *
* Copyright 2022 Ben Vanik. All rights reserved. *
* Released under the BSD license - see LICENSE in the root for more details. *
******************************************************************************
*/
#include "xenia/ui/surface_win.h"
#include <algorithm>
#include <memory>
#include "xenia/base/logging.h"
namespace xe {
namespace ui {
@@ -24,9 +19,9 @@ bool Win32HwndSurface::GetSizeImpl(uint32_t& width_out,
if (!GetClientRect(hwnd(), &client_rect)) {
return false;
}
width_out = uint32_t(std::max(client_rect.right - client_rect.left, LONG(0)));
height_out =
uint32_t(std::max(client_rect.bottom - client_rect.top, LONG(0)));
// GetClientRect returns a rectangle with 0 origin.
width_out = uint32_t(client_rect.right);
height_out = uint32_t(client_rect.bottom);
return true;
}
#endif