Prevent tooltips from going off the top of the screen.

This commit is contained in:
mezz 2017-12-06 21:10:51 -08:00
parent bd494af7ee
commit 49596910fc
1 changed files with 6 additions and 2 deletions

View File

@ -361,9 +361,13 @@ public class GuiUtils
}
}
if (tooltipY + tooltipHeight + 6 > screenHeight)
if (tooltipY < 4)
{
tooltipY = screenHeight - tooltipHeight - 6;
tooltipY = 4;
}
else if (tooltipY + tooltipHeight + 4 > screenHeight)
{
tooltipY = screenHeight - tooltipHeight - 4;
}
final int zLevel = 300;