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
commit48bb9ff17c152cf9fce3465d1d922349bf96a092 (patch)
treec01e48a138d5885daee2e15c5134dc648cbed906 /src/toolbar_gui.cpp
parentd177952455d973d87c1850406ce503068b1c6c8d (diff)
downloadopenttd-48bb9ff17c152cf9fce3465d1d922349bf96a092.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;
}