Resize the window when changing the screen gap.

This commit is contained in:
SuuperW 2018-07-18 12:20:03 -05:00
parent a4411086e0
commit 84e8057682
1 changed files with 10 additions and 0 deletions

View File

@ -3708,7 +3708,17 @@ void FixAspectRatio()
void SetScreenGap(int gap)
{
RECT clientRect;
GetClientRect(MainWindow->getHWnd(), &clientRect);
RECT rc;
GetWindowRect(MainWindow->getHWnd(), &rc);
if (video.rotation == 0 || video.rotation == 180)
rc.bottom += (gap - video.screengap) * (clientRect.right - clientRect.left) / GPU_FRAMEBUFFER_NATIVE_WIDTH;
else
rc.right += (gap - video.screengap) * (clientRect.bottom - clientRect.top - MainWindowToolbar->GetHeight()) / GPU_FRAMEBUFFER_NATIVE_WIDTH;
video.screengap = gap;
MoveWindow(MainWindow->getHWnd(), rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top, TRUE);
SetMinWindowSize();
FixAspectRatio();
UpdateWndRects(MainWindow->getHWnd());