From 74a9be4f59aa918b3b53b67a0a72881747259027 Mon Sep 17 00:00:00 2001 From: alberth Date: Sun, 1 Nov 2009 17:20:28 +0000 Subject: [PATCH] (svn r17932) -Fix: Don't let the tooltip go under the status bar. --- src/misc_gui.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/misc_gui.cpp b/src/misc_gui.cpp index ecd00bc26a..e434d9a64f 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;