(svn r12402) -Fix: some toolbars didn't seem to show anymore.

This commit is contained in:
rubidium
2008-03-24 05:59:42 +00:00
parent d177952455
commit 48bb9ff17c
2 changed files with 8 additions and 17 deletions

View File

@@ -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;
}