Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Fixed increasing the size of resizable windows
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Feb 12, 2013
1 parent 370c5aa commit 90db6be
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/video/windows/SDL_windowsevents.c
Expand Up @@ -451,6 +451,7 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
int max_w, max_h;
int style;
BOOL menu;
BOOL constrain_max_size;

/* If we allow resizing, let the resize happen naturally */
if (SDL_IsShapedWindow(data->window))
Expand All @@ -473,6 +474,9 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
if (max_w && max_h) {
max_w -= w;
max_h -= h;
constrain_max_size = TRUE;
} else {
constrain_max_size = FALSE;
}

size.top = 0;
Expand All @@ -496,8 +500,10 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
if (SDL_GetWindowFlags(data->window) & SDL_WINDOW_RESIZABLE) {
info->ptMinTrackSize.x = w + min_w;
info->ptMinTrackSize.y = h + min_h;
info->ptMaxTrackSize.x = w + max_w;
info->ptMaxTrackSize.y = h + max_h;
if (constrain_max_size) {
info->ptMaxTrackSize.x = w + max_w;
info->ptMaxTrackSize.y = h + max_h;
}
} else {
info->ptMaxSize.x = w;
info->ptMaxSize.y = h;
Expand Down

0 comments on commit 90db6be

Please sign in to comment.