Fix issue with resizing the window vertically.
This commit is contained in:
parent
842ed1b93c
commit
a4411086e0
|
@ -1137,7 +1137,7 @@ RECT CalculateDisplayLayoutWrapper(RECT rcClient, int targetWidth, int targetHei
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
void UpdateWndRects(HWND hwnd)
|
void UpdateWndRects(HWND hwnd, RECT* newClientRect = NULL)
|
||||||
{
|
{
|
||||||
POINT ptClient;
|
POINT ptClient;
|
||||||
RECT rc;
|
RECT rc;
|
||||||
|
@ -1152,7 +1152,11 @@ void UpdateWndRects(HWND hwnd)
|
||||||
int oneScreenHeight, gapHeight;
|
int oneScreenHeight, gapHeight;
|
||||||
int tbheight;
|
int tbheight;
|
||||||
|
|
||||||
GetClientRect(hwnd, &rc);
|
//if we're in the middle of resizing the window, GetClientRect will return the old rect
|
||||||
|
if (newClientRect)
|
||||||
|
rc = RECT(*newClientRect);
|
||||||
|
else
|
||||||
|
GetClientRect(hwnd, &rc);
|
||||||
|
|
||||||
if(maximized)
|
if(maximized)
|
||||||
rc = FullScreenRect;
|
rc = FullScreenRect;
|
||||||
|
@ -4933,12 +4937,11 @@ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM
|
||||||
wndHeightGapless = (MainScreenRect.bottom - MainScreenRect.top) + (SubScreenRect.bottom - SubScreenRect.top);
|
wndHeightGapless = (MainScreenRect.bottom - MainScreenRect.top) + (SubScreenRect.bottom - SubScreenRect.top);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(ForceRatio)
|
video.screengap = GPU_FRAMEBUFFER_NATIVE_WIDTH * (wndHeight - wndHeightGapless) / wndWidth;
|
||||||
video.screengap = (wndHeight * video.width / wndWidth - video.height);
|
|
||||||
else
|
|
||||||
video.screengap = wndHeight * video.height / wndHeightGapless - video.height;
|
|
||||||
|
|
||||||
UpdateWndRects(MainWindow->getHWnd());
|
rc.bottom -= rc.top; rc.top = 0;
|
||||||
|
rc.right -= rc.left; rc.left = 0;
|
||||||
|
UpdateWndRects(MainWindow->getHWnd(), &rc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
|
|
Loading…
Reference in New Issue