Changeset - r7364:402476671c12
[Not reviewed]
master
0 1 0
rubidium - 17 years ago 2007-07-29 20:54:37
rubidium@openttd.org
(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.
1 file changed with 2 insertions and 0 deletions:
0 comments (0 inline, 0 general)
src/window.cpp
Show inline comments
 
@@ -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);
0 comments (0 inline, 0 general)