aboutsummaryrefslogtreecommitdiffstats
path: root/src/win.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/win.c')
-rw-r--r--src/win.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/win.c b/src/win.c
index 75e0d71..53f7142 100644
--- a/src/win.c
+++ b/src/win.c
@@ -739,7 +739,8 @@ handleMessage(PuglView* view, UINT message, WPARAM wParam, LPARAM lParam)
handleConfigure(view, &event);
break;
case WM_SIZING:
- if (view->sizeHints[PUGL_MIN_ASPECT].width) {
+ if (puglIsValidSize(view->sizeHints[PUGL_MIN_ASPECT]) &&
+ puglIsValidSize(view->sizeHints[PUGL_MAX_ASPECT])) {
constrainAspect(view, (RECT*)lParam, wParam);
return TRUE;
}
@@ -771,8 +772,7 @@ handleMessage(PuglView* view, UINT message, WPARAM wParam, LPARAM lParam)
mmi = (MINMAXINFO*)lParam;
mmi->ptMinTrackSize.x = view->sizeHints[PUGL_MIN_SIZE].width;
mmi->ptMinTrackSize.y = view->sizeHints[PUGL_MIN_SIZE].height;
- if (view->sizeHints[PUGL_MAX_SIZE].width &&
- view->sizeHints[PUGL_MAX_SIZE].height) {
+ if (puglIsValidSize(view->sizeHints[PUGL_MAX_SIZE])) {
mmi->ptMaxTrackSize.x = view->sizeHints[PUGL_MAX_SIZE].width;
mmi->ptMaxTrackSize.y = view->sizeHints[PUGL_MAX_SIZE].height;
}