diff options
author | alberth <alberth@openttd.org> | 2009-11-01 17:20:28 +0000 |
---|---|---|
committer | alberth <alberth@openttd.org> | 2009-11-01 17:20:28 +0000 |
commit | d213ffe3cab161860e6efa669a72993891600bfa (patch) | |
tree | f120a648a19734b092582bbc91af0a806833fe8b /src | |
parent | 898f20ce5649b2e1763c834e9a2a064dc1addc9e (diff) | |
download | openttd-d213ffe3cab161860e6efa669a72993891600bfa.tar.xz |
(svn r17932) -Fix: Don't let the tooltip go under the status bar.
Diffstat (limited to 'src')
-rw-r--r-- | src/misc_gui.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/misc_gui.cpp b/src/misc_gui.cpp index ecd00bc26..e434d9a64 100644 --- a/src/misc_gui.cpp +++ b/src/misc_gui.cpp @@ -816,7 +816,7 @@ struct TooltipsWindow : public Window * Clamp value to below main toolbar and above statusbar. If tooltip would * go below window, flip it so it is shown above the cursor */ pt.y = Clamp(_cursor.pos.y + _cursor.size.y + _cursor.offs.y + 5, 22, _screen.height - 12); - if (pt.y + sm_height > _screen.height - 12) pt.y = _cursor.pos.y + _cursor.offs.y - sm_height - 5; + if (pt.y + sm_height > _screen.height - 12) pt.y = min(_cursor.pos.y + _cursor.offs.y - 5, _screen.height - 12) - sm_height; pt.x = Clamp(_cursor.pos.x - (sm_width >> 1), 0, _screen.width - sm_width); return pt; |