fix: Left/Right resizing not working correctly on Windows
This commit is contained in:
parent
8f07f0f8ae
commit
5c9d0e29c2
@ -87,13 +87,13 @@ namespace hex {
|
|||||||
if (IsMaximized(hwnd)) {
|
if (IsMaximized(hwnd)) {
|
||||||
WINDOWINFO windowInfo = { };
|
WINDOWINFO windowInfo = { };
|
||||||
windowInfo.cbSize = sizeof(WINDOWINFO);
|
windowInfo.cbSize = sizeof(WINDOWINFO);
|
||||||
|
|
||||||
GetWindowInfo(hwnd, &windowInfo);
|
GetWindowInfo(hwnd, &windowInfo);
|
||||||
|
|
||||||
rect = RECT {
|
rect = RECT {
|
||||||
.left = static_cast<LONG>(client.left + windowInfo.cyWindowBorders),
|
.left = static_cast<LONG>(client.left + windowInfo.cyWindowBorders),
|
||||||
.top = static_cast<LONG>(client.top + windowInfo.cyWindowBorders),
|
.top = static_cast<LONG>(client.top + windowInfo.cyWindowBorders),
|
||||||
.right = static_cast<LONG>(client.right - windowInfo.cyWindowBorders),
|
.right = static_cast<LONG>(client.right - windowInfo.cyWindowBorders * 2),
|
||||||
.bottom = static_cast<LONG>(client.bottom - windowInfo.cyWindowBorders) + 1
|
.bottom = static_cast<LONG>(client.bottom - windowInfo.cyWindowBorders * 2) + 1
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
rect = client;
|
rect = client;
|
||||||
@ -138,8 +138,8 @@ namespace hex {
|
|||||||
POINT cursor = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) };
|
POINT cursor = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) };
|
||||||
|
|
||||||
const POINT border {
|
const POINT border {
|
||||||
static_cast<LONG>((::GetSystemMetrics(SM_CXFRAME) + ::GetSystemMetrics(SM_CXPADDEDBORDER)) * ImHexApi::System::getGlobalScale() / 1.5F),
|
static_cast<LONG>((::GetSystemMetrics(SM_CXFRAME) + ::GetSystemMetrics(SM_CXPADDEDBORDER)) * ImHexApi::System::getNativeScale()),
|
||||||
static_cast<LONG>((::GetSystemMetrics(SM_CYFRAME) + ::GetSystemMetrics(SM_CXPADDEDBORDER)) * ImHexApi::System::getGlobalScale() / 1.5F)
|
static_cast<LONG>((::GetSystemMetrics(SM_CYFRAME) + ::GetSystemMetrics(SM_CXPADDEDBORDER)) * ImHexApi::System::getNativeScale())
|
||||||
};
|
};
|
||||||
|
|
||||||
RECT window;
|
RECT window;
|
||||||
@ -164,7 +164,7 @@ namespace hex {
|
|||||||
|
|
||||||
if (GImGui->HoveredWindow != nullptr &&
|
if (GImGui->HoveredWindow != nullptr &&
|
||||||
GImGui->HoveredWindow->Name != std::string("##MainMenuBar") &&
|
GImGui->HoveredWindow->Name != std::string("##MainMenuBar") &&
|
||||||
GImGui->HoveredWindow->Name != std::string("ImHexDockSpace"))
|
!std::string_view(GImGui->HoveredWindow->Name).starts_with("ImHexDockSpace"))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
switch (result) {
|
switch (result) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user