mirror of https://github.com/OpenTTD/OpenTTD.git
(svn r12371) -Fix [FS#1823]: do not let window hide behind the main toolbar after resizing the screen
This commit is contained in:
parent
058724b768
commit
756e0d9b6e
|
@ -2175,15 +2175,22 @@ void RelocateAllWindows(int neww, int newh)
|
||||||
IConsoleResize(w);
|
IConsoleResize(w);
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
default:
|
default: {
|
||||||
left = w->left;
|
left = w->left;
|
||||||
if (left + (w->width >> 1) >= neww) left = neww - w->width;
|
if (left + (w->width >> 1) >= neww) left = neww - w->width;
|
||||||
if (left < 0) left = 0;
|
if (left < 0) left = 0;
|
||||||
|
|
||||||
top = w->top;
|
top = w->top;
|
||||||
if (top + (w->height >> 1) >= newh) top = newh - w->height;
|
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) {
|
if (w->viewport != NULL) {
|
||||||
|
|
Loading…
Reference in New Issue