aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorxander <xander@isxander.dev>2022-09-20 19:06:46 +0100
committerxander <xander@isxander.dev>2022-09-20 19:06:46 +0100
commit2ffdf3ecb7890adb796c81808655dbbd624b25bb (patch)
treed1af318479817e52dbaf5832870a8a7dda74df51 /src/main
parent22fa08459b8c5e99e1e309ae42a146026246c422 (diff)
downloadYetAnotherConfigLib-2ffdf3ecb7890adb796c81808655dbbd624b25bb.tar.gz
YetAnotherConfigLib-2ffdf3ecb7890adb796c81808655dbbd624b25bb.tar.bz2
YetAnotherConfigLib-2ffdf3ecb7890adb796c81808655dbbd624b25bb.zip
Fix cancel/reset button tooltip going off-screen
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/dev/isxander/yacl/gui/YACLScreen.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/main/java/dev/isxander/yacl/gui/YACLScreen.java b/src/main/java/dev/isxander/yacl/gui/YACLScreen.java
index 6323e1c..63cb2f6 100644
--- a/src/main/java/dev/isxander/yacl/gui/YACLScreen.java
+++ b/src/main/java/dev/isxander/yacl/gui/YACLScreen.java
@@ -12,6 +12,7 @@ import net.minecraft.client.render.*;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.text.Text;
import net.minecraft.util.Formatting;
+import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.Matrix4f;
import java.util.HashSet;
@@ -230,7 +231,7 @@ public class YACLScreen extends Screen {
if (maxBelow < -8)
y = maxBelow > minAbove ? belowY : aboveY;
- int x = centerX - text.getMaxWidth() / 2 - 12;
+ int x = Math.max(centerX - text.getMaxWidth() / 2 - 12, -6);
int drawX = x + 12;
int drawY = y - 12;