winport - fix bugs in fullscreen viewport sizing

This commit is contained in:
zeromus 2015-10-04 18:12:14 +00:00
parent 60ea6fe7d5
commit 3308d5b28e
2 changed files with 13 additions and 4 deletions

View File

@ -640,7 +640,8 @@ void WINCLASS::sizingMsg(WPARAM wParam, LPARAM lParam, LONG keepRatio)
RECT adjr;
SetRect(&adjr,0,0,minWidth,minHeight);
MyAdjustWindowRectEx(&adjr,hwnd);
if(!(keepRatio & FULLSCREEN))
MyAdjustWindowRectEx(&adjr,hwnd);
RECT frameInfo;
SetRect(&frameInfo,0,0,0,0);
@ -648,6 +649,9 @@ void WINCLASS::sizingMsg(WPARAM wParam, LPARAM lParam, LONG keepRatio)
int frameWidth = frameInfo.right-frameInfo.left;
int frameHeight = frameInfo.bottom-frameInfo.top + tbheight;
if((keepRatio & FULLSCREEN))
frameWidth = frameHeight = 0;
// Calculate the minimum size in pixels
_minWidth = adjr.right-adjr.left;
_minHeight = adjr.bottom-adjr.top + tbheight;

View File

@ -4948,9 +4948,14 @@ DOKEYDOWN:
int fakeheight = FullScreenRect.bottom-FullScreenRect.top;
//now use it to create a new virtual area in the center of the client rect
int xfudge = (fswidth-fakewidth)/2;
int yfudge = (fsheight-fakeheight)/2;
OffsetRect(&FullScreenRect,xfudge,yfudge);
if(ForceRatio)
{
int xfudge = (fswidth-fakewidth)/2;
int yfudge = (fsheight-fakeheight)/2;
OffsetRect(&FullScreenRect,xfudge,yfudge);
}
else
FullScreenRect = fullscreen;
}
else if(wParam==SIZE_RESTORED)
{