changeset 7364:66ec57c74f9e draft

(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.
author rubidium <rubidium@openttd.org>
date Sun, 29 Jul 2007 20:54:37 +0000
parents 796611c3f3eb
children fead570b1076
files src/window.cpp
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/window.cpp
+++ b/src/window.cpp
@@ -689,6 +689,8 @@
 		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);