diff options
author | smatz <smatz@openttd.org> | 2008-03-15 20:32:42 +0000 |
---|---|---|
committer | smatz <smatz@openttd.org> | 2008-03-15 20:32:42 +0000 |
commit | 756e0d9b6e003abe0d60fa0554ce446a2985cc09 (patch) | |
tree | 11c075a411adf6b0b13ad72a682965533f8377fa /src | |
parent | 058724b7682ab57234eb0c296de5e7ed88c509e0 (diff) | |
download | openttd-756e0d9b6e003abe0d60fa0554ce446a2985cc09.tar.xz |
(svn r12371) -Fix [FS#1823]: do not let window hide behind the main toolbar after resizing the screen
Diffstat (limited to 'src')
-rw-r--r-- | src/window.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/window.cpp b/src/window.cpp index 82b6ced25..035d2bf92 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -2175,15 +2175,22 @@ void RelocateAllWindows(int neww, int newh) IConsoleResize(w); continue; - default: + 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; + + const Window *wt = FindWindowById(WC_MAIN_TOOLBAR, 0); + if (wt != NULL) { + if (top < wt->height) top = wt->height; + if (top >= newh) top = newh - 1; + } else { + if (top < 0) top = 0; + } + } break; } if (w->viewport != NULL) { |