Merge pull request #2543 from FlagellumDei/patch-1

centerWindow() fix
This commit is contained in:
minggo 2013-05-12 19:44:15 -07:00
commit 3ebb61a09c
1 changed files with 2 additions and 2 deletions

View File

@ -693,9 +693,9 @@ void CCEGLView::centerWindow()
} }
GetWindowRect(m_hWnd, &rcWindow); GetWindowRect(m_hWnd, &rcWindow);
int offsetX = (rcDesktop.right - rcDesktop.left - (rcWindow.right - rcWindow.left)) / 2; int offsetX = rcDesktop.left + (rcDesktop.right - rcDesktop.left - (rcWindow.right - rcWindow.left)) / 2;
offsetX = (offsetX > 0) ? offsetX : rcDesktop.left; offsetX = (offsetX > 0) ? offsetX : rcDesktop.left;
int offsetY = (rcDesktop.bottom - rcDesktop.top - (rcWindow.bottom - rcWindow.top)) / 2; int offsetY = rcDesktop.top + (rcDesktop.bottom - rcDesktop.top - (rcWindow.bottom - rcWindow.top)) / 2;
offsetY = (offsetY > 0) ? offsetY : rcDesktop.top; offsetY = (offsetY > 0) ? offsetY : rcDesktop.top;
SetWindowPos(m_hWnd, 0, offsetX, offsetY, 0, 0, SWP_NOCOPYBITS | SWP_NOSIZE | SWP_NOOWNERZORDER | SWP_NOZORDER); SetWindowPos(m_hWnd, 0, offsetX, offsetY, 0, 0, SWP_NOCOPYBITS | SWP_NOSIZE | SWP_NOOWNERZORDER | SWP_NOZORDER);