mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-06-20 20:19:35 +01:00
(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.
This commit is contained in:
parent
da216d9c2a
commit
351c7ab097
@ -2801,25 +2801,11 @@ void RelocateAllWindows(int neww, int newh)
|
|||||||
|
|
||||||
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;
|
||||||
|
|
||||||
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;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (w->viewport != NULL) {
|
EnsureVisibleCaption(w, left, top);
|
||||||
w->viewport->left += left - w->left;
|
|
||||||
w->viewport->top += top - w->top;
|
|
||||||
}
|
|
||||||
|
|
||||||
w->left = left;
|
|
||||||
w->top = top;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user