Fixed increasing the size of resizable windows
authorSam Lantinga <slouken@libsdl.org>
Mon, 11 Feb 2013 21:39:58 -0800
changeset 6862 d189a1e771fe
parent 6861 c1c9eab3bd20
child 6863 73be5b6b2a86
Fixed increasing the size of resizable windows
src/video/windows/SDL_windowsevents.c
--- a/src/video/windows/SDL_windowsevents.c	Mon Feb 11 21:29:36 2013 -0800
+++ b/src/video/windows/SDL_windowsevents.c	Mon Feb 11 21:39:58 2013 -0800
@@ -451,6 +451,7 @@
             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))
@@ -473,6 +474,9 @@
             if (max_w && max_h) {
                 max_w -= w;
                 max_h -= h;
+                constrain_max_size = TRUE;
+            } else {
+                constrain_max_size = FALSE;
             }
 
             size.top = 0;
@@ -496,8 +500,10 @@
             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;