File diff r12458:1218346ee511 → r12459:0355f2f0513a
src/window.cpp
Show inline comments
 
@@ -1195,13 +1195,13 @@ restart:
 

	
 
/**
 
 * Compute the position of the top-left corner of a new window that is opened.
 
 *
 
 * By default position a child window at an offset of 10/10 of its parent.
 
 * With the exception of WC_BUILD_TOOLBAR (build railway/roads/ship docks/airports)
 
 * and WC_SCEN_LAND_GEN (landscaping). Whose child window has an offset of 0/36 of
 
 * and WC_SCEN_LAND_GEN (landscaping). Whose child window has an offset of 0/toolbar-height of
 
 * its parent. So it's exactly under the parent toolbar and no buttons will be covered.
 
 * However if it falls too extremely outside window positions, reposition
 
 * it to an automatic place.
 
 *
 
 * @param *desc         The pointer to the WindowDesc to be created.
 
 * @param sm_width      Smallest width of the window.
 
@@ -1223,13 +1223,13 @@ static Point LocalGetWindowPlacement(con
 
			w->left < _screen.width - 20 && w->left > -60 && w->top < _screen.height - 20) {
 

	
 
		pt.x = w->left + ((desc->parent_cls == WC_BUILD_TOOLBAR || desc->parent_cls == WC_SCEN_LAND_GEN) ? 0 : 10);
 
		if (pt.x > _screen.width + 10 - default_width) {
 
			pt.x = (_screen.width + 10 - default_width) - 20;
 
		}
 
		pt.y = w->top + ((desc->parent_cls == WC_BUILD_TOOLBAR || desc->parent_cls == WC_SCEN_LAND_GEN) ? 36 : 10);
 
		pt.y = w->top + ((desc->parent_cls == WC_BUILD_TOOLBAR || desc->parent_cls == WC_SCEN_LAND_GEN) ? w->height : 10);
 
	} else {
 
		switch (desc->left) {
 
			case WDP_ALIGN_TBR: // Align the right side with the top toolbar
 
				w = FindWindowById(WC_MAIN_TOOLBAR, 0);
 
				pt.x = (w->left + w->width) - default_width;
 
				break;