Take gui.scale into account when repositioning tooltips

Patch by: joskar
Differential Revision: https://code.wildfiregames.com/D749
This was SVN commit r19928.
This commit is contained in:
Imarok 2017-07-29 18:30:59 +00:00
parent 1638727c23
commit 3fca871fd6
2 changed files with 4 additions and 1 deletions

View file

@ -106,6 +106,7 @@
{"nick": "Jgwman"},
{"nick": "JonBaer", "name": "Jon Baer"},
{"nick": "Josh", "name": "Joshua J. Bakita"},
{"nick": "joskar", "name": "Johnny Oskarsson"},
{"nick": "jP_wanN", "name": "Jonas Platte"},
{"nick": "Jubalbarca", "name": "James Baillie"},
{"nick": "JubJub", "name": "Sebastian Vetter"},

View file

@ -127,7 +127,9 @@ void CTooltip::SetupText()
// Reposition the tooltip if it's falling off the screen:
extern int g_xres, g_yres;
float screenw = (float)g_xres, screenh = (float)g_yres;
extern float g_GuiScale;
float screenw = g_xres / g_GuiScale;
float screenh = g_yres / g_GuiScale;
if (size.pixel.top < 0.f)
size.pixel.bottom -= size.pixel.top, size.pixel.top = 0.f;