summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-12-06 20:55:48 +0000
committerrubidium <rubidium@openttd.org>2007-12-06 20:55:48 +0000
commit39b1a8302b6519b185445faf6beef9356543b905 (patch)
tree6454bd8c9874ba45f74d56b366ce77cfc342fd0d /src
parent57fc61009ed901291b44e646d9a2093730fa47d5 (diff)
downloadopenttd-39b1a8302b6519b185445faf6beef9356543b905.tar.xz
(svn r11583) -Fix [FS#1484]: windows could get completely missing when one resized the window to something very small.
Diffstat (limited to 'src')
-rw-r--r--src/window.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/window.cpp b/src/window.cpp
index 33063fbeb..e22c4c87e 100644
--- a/src/window.cpp
+++ b/src/window.cpp
@@ -2197,8 +2197,11 @@ void RelocateAllWindows(int neww, int newh)
default:
left = w->left;
if (left + (w->width >> 1) >= neww) left = neww - w->width;
+ if (left < 0) left = 0;
+
top = w->top;
if (top + (w->height >> 1) >= newh) top = newh - w->height;
+ if (top < 0) top = 0;
break;
}