mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-06 14:27:16 +00:00
(svn r10727) -Codechange: when a window would fall outside of the screen (on the right) when opening it, move it to the left so it stays inside the screen.
This commit is contained in:
parent
dd0fac984b
commit
1ff82506a0
@ -689,6 +689,8 @@ static Window *LocalAllocateWindow(
|
||||
w->wndproc(w, &e);
|
||||
}
|
||||
|
||||
if (w->left + w->width > _screen.width) w->left -= (w->left + w->width - _screen.width);
|
||||
|
||||
const Window *wt = FindWindowById(WC_MAIN_TOOLBAR, 0);
|
||||
w->top = max(w->top, (wt == NULL || w == wt || y == 0) ? 0 : wt->height);
|
||||
w->left = max(w->left, 0);
|
||||
|
Loading…
Reference in New Issue
Block a user