summaryrefslogtreecommitdiff
path: root/src/toolbar_gui.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-03-24 05:59:42 +0000
committerrubidium <rubidium@openttd.org>2008-03-24 05:59:42 +0000
commit37d961c8e7ed3832ccfe99e9bd462828d9747dc7 (patch)
treec01e48a138d5885daee2e15c5134dc648cbed906 /src/toolbar_gui.cpp
parent3f3598bd762f7994141998e968c833050f068186 (diff)
downloadopenttd-37d961c8e7ed3832ccfe99e9bd462828d9747dc7.tar.xz
(svn r12402) -Fix: some toolbars didn't seem to show anymore.
Diffstat (limited to 'src/toolbar_gui.cpp')
-rw-r--r--src/toolbar_gui.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/toolbar_gui.cpp b/src/toolbar_gui.cpp
index 0b89d1e54..309120e2f 100644
--- a/src/toolbar_gui.cpp
+++ b/src/toolbar_gui.cpp
@@ -45,12 +45,11 @@ extern RoadType _last_built_roadtype;
* the default position is aligned with the left side of the clicked button */
Point GetToolbarDropdownPos(uint16 parent_button, int width, int height)
{
- Window *w = FindWindowById(WC_MAIN_TOOLBAR,0);
+ const Window *w = FindWindowById(WC_MAIN_TOOLBAR,0);
Point pos;
- pos.x = w->widget[GB(parent_button, 0, 8)].left;
- pos.y = -height;
+ pos.x = w->widget[GB(parent_button, 0, 8)].left;
pos.x = w->left + Clamp(pos.x, 0, w->width - width);
- pos.y = w->top + pos.y;
+ pos.y = w->height;
return pos;
}