summaryrefslogtreecommitdiff
path: root/src/window.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2011-05-21 22:22:02 +0000
committerfrosch <frosch@openttd.org>2011-05-21 22:22:02 +0000
commit351c7ab097390efb971ff0f410fb025599ef3ecc (patch)
tree3b13dc5db0d968d6346a13350ab8536054074ee0 /src/window.cpp
parentda216d9c2a963cd7f8c04e81363e3d02890293cb (diff)
downloadopenttd-351c7ab097390efb971ff0f410fb025599ef3ecc.tar.xz
(svn r22484) -Fix: The caption of centered windows could be moved out of the main window and thus become inaccessible when resizing the main window.
Diffstat (limited to 'src/window.cpp')
-rw-r--r--src/window.cpp16
1 files changed, 1 insertions, 15 deletions
diff --git a/src/window.cpp b/src/window.cpp
index b167cbb78..572be9f37 100644
--- a/src/window.cpp
+++ b/src/window.cpp
@@ -2801,25 +2801,11 @@ void RelocateAllWindows(int neww, int newh)
top = w->top;
if (top + (w->height >> 1) >= newh) top = newh - w->height;
-
- const Window *wt = FindWindowById(WC_MAIN_TOOLBAR, 0);
- if (wt != NULL) {
- if (top < wt->height && wt->left < (w->left + w->width) && (wt->left + wt->width) > w->left) top = wt->height;
- if (top >= newh) top = newh - 1;
- } else {
- if (top < 0) top = 0;
- }
break;
}
}
- if (w->viewport != NULL) {
- w->viewport->left += left - w->left;
- w->viewport->top += top - w->top;
- }
-
- w->left = left;
- w->top = top;
+ EnsureVisibleCaption(w, left, top);
}
}