Changeset - r8698:e86d48de76e2
[Not reviewed]
master
0 1 0
smatz - 16 years ago 2008-03-15 20:32:42
smatz@openttd.org
(svn r12371) -Fix [FS#1823]: do not let window hide behind the main toolbar after resizing the screen
1 file changed with 10 insertions and 3 deletions:
0 comments (0 inline, 0 general)
src/window.cpp
Show inline comments
 
@@ -2175,15 +2175,22 @@ void RelocateAllWindows(int neww, int ne
 
				IConsoleResize(w);
 
				continue;
 

	
 
			default:
 
			default: {
 
				left = w->left;
 
				if (left + (w->width >> 1) >= neww) left = neww - w->width;
 
				if (left < 0) left = 0;
 

	
 
				top = w->top;
 
				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) {
0 comments (0 inline, 0 general)