mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-16 00:12:51 +00:00
(svn r20596) -Fix [FS#4066]: crash when the tooltip is wider than the window is
This commit is contained in:
parent
de1b7fd8de
commit
d15d8ecde4
@ -852,7 +852,7 @@ struct TooltipsWindow : public Window
|
||||
* 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, scr_top, scr_bot);
|
||||
if (pt.y + sm_height > scr_bot) pt.y = min(_cursor.pos.y + _cursor.offs.y - 5, scr_bot) - sm_height;
|
||||
pt.x = Clamp(_cursor.pos.x - (sm_width >> 1), 0, _screen.width - sm_width);
|
||||
pt.x = sm_width >= _screen.width ? 0 : Clamp(_cursor.pos.x - (sm_width >> 1), 0, _screen.width - sm_width);
|
||||
|
||||
return pt;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user