summaryrefslogtreecommitdiff
path: root/src/window.cpp
diff options
context:
space:
mode:
authoralberth <alberth@openttd.org>2009-07-21 22:25:21 +0000
committeralberth <alberth@openttd.org>2009-07-21 22:25:21 +0000
commit8083d67780d6a85c558080ec99dd2d24ae755d0f (patch)
treeb1639f095175d1ff0444f5ae8197ded9e79000f7 /src/window.cpp
parent639a829f87d6c3363e0930987a0953c9851ac636 (diff)
downloadopenttd-8083d67780d6a85c558080ec99dd2d24ae755d0f.tar.xz
(svn r16906) -Fix (r12939): Child windows of build toolbars were placed inconsistently.
Diffstat (limited to 'src/window.cpp')
-rw-r--r--src/window.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/window.cpp b/src/window.cpp
index 00e42ff72..60519f3ee 100644
--- a/src/window.cpp
+++ b/src/window.cpp
@@ -1198,7 +1198,7 @@ restart:
*
* 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.
@@ -1226,7 +1226,7 @@ static Point LocalGetWindowPlacement(const WindowDesc *desc, int16 sm_width, int
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