adjust for window border when loading window position too

fixes window moving up every time on windows, on linux the border size gets reported as 0 so nothing changes there
This commit is contained in:
jacob1 2018-05-26 17:38:01 -04:00
parent 743ec98e3f
commit 324602fe26

View File

@ -84,7 +84,11 @@ void LoadWindowPosition()
{
int savedWindowX = Client::Ref().GetPrefInteger("WindowX", INT_MAX);
int savedWindowY = Client::Ref().GetPrefInteger("WindowY", INT_MAX);
SDL_SetWindowPosition(sdl_window, savedWindowX, savedWindowY);
int borderTop, borderLeft;
SDL_GetWindowBordersSize(sdl_window, &borderTop, &borderLeft, nullptr, nullptr);
SDL_SetWindowPosition(sdl_window, savedWindowX + borderLeft, savedWindowY + borderTop);
}
void SaveWindowPosition()