From 49596910fc7d4ffd3b83895ab329d7a230d5ea6a Mon Sep 17 00:00:00 2001 From: mezz Date: Wed, 6 Dec 2017 21:10:51 -0800 Subject: [PATCH] Prevent tooltips from going off the top of the screen. --- .../net/minecraftforge/fml/client/config/GuiUtils.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/minecraftforge/fml/client/config/GuiUtils.java b/src/main/java/net/minecraftforge/fml/client/config/GuiUtils.java index 5c8a5374be..016763942b 100644 --- a/src/main/java/net/minecraftforge/fml/client/config/GuiUtils.java +++ b/src/main/java/net/minecraftforge/fml/client/config/GuiUtils.java @@ -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;