diff options
author | xander <xander@isxander.dev> | 2022-09-20 19:06:46 +0100 |
---|---|---|
committer | xander <xander@isxander.dev> | 2022-09-20 19:06:46 +0100 |
commit | 2ffdf3ecb7890adb796c81808655dbbd624b25bb (patch) | |
tree | d1af318479817e52dbaf5832870a8a7dda74df51 /src/main | |
parent | 22fa08459b8c5e99e1e309ae42a146026246c422 (diff) | |
download | YetAnotherConfigLib-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.java | 3 |
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; |