Fixed increasing the size of resizable windows
authorSam Lantinga <slouken@libsdl.org>
Mon, 11 Feb 2013 21:39:58 -0800
changeset 6862d189a1e771fe
parent 6861 c1c9eab3bd20
child 6863 73be5b6b2a86
Fixed increasing the size of resizable windows
src/video/windows/SDL_windowsevents.c
     1.1 --- a/src/video/windows/SDL_windowsevents.c	Mon Feb 11 21:29:36 2013 -0800
     1.2 +++ b/src/video/windows/SDL_windowsevents.c	Mon Feb 11 21:39:58 2013 -0800
     1.3 @@ -451,6 +451,7 @@
     1.4              int max_w, max_h;
     1.5              int style;
     1.6              BOOL menu;
     1.7 +			BOOL constrain_max_size;
     1.8  
     1.9              /* If we allow resizing, let the resize happen naturally */
    1.10              if (SDL_IsShapedWindow(data->window))
    1.11 @@ -473,6 +474,9 @@
    1.12              if (max_w && max_h) {
    1.13                  max_w -= w;
    1.14                  max_h -= h;
    1.15 +                constrain_max_size = TRUE;
    1.16 +            } else {
    1.17 +                constrain_max_size = FALSE;
    1.18              }
    1.19  
    1.20              size.top = 0;
    1.21 @@ -496,8 +500,10 @@
    1.22              if (SDL_GetWindowFlags(data->window) & SDL_WINDOW_RESIZABLE) {
    1.23                  info->ptMinTrackSize.x = w + min_w;
    1.24                  info->ptMinTrackSize.y = h + min_h;
    1.25 -                info->ptMaxTrackSize.x = w + max_w;
    1.26 -                info->ptMaxTrackSize.y = h + max_h;
    1.27 +                if (constrain_max_size) {
    1.28 +                    info->ptMaxTrackSize.x = w + max_w;
    1.29 +                    info->ptMaxTrackSize.y = h + max_h;
    1.30 +                }
    1.31              } else {
    1.32                  info->ptMaxSize.x = w;
    1.33                  info->ptMaxSize.y = h;