diff options
-rw-r--r-- | build.gradle.kts | 2 | ||||
-rw-r--r-- | changelogs/1.4.2.md | 1 | ||||
-rw-r--r-- | src/main/java/dev/isxander/yacl/gui/YACLScreen.java | 3 |
3 files changed, 4 insertions, 2 deletions
diff --git a/build.gradle.kts b/build.gradle.kts index 2bab14b..9a62900 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -16,7 +16,7 @@ plugins { val ciRun = System.getenv().containsKey("GITHUB_ACTIONS") group = "dev.isxander" -version = "1.4.1" +version = "1.4.2" if (ciRun) version = "$version-SNAPSHOT" diff --git a/changelogs/1.4.2.md b/changelogs/1.4.2.md new file mode 100644 index 0000000..c87d133 --- /dev/null +++ b/changelogs/1.4.2.md @@ -0,0 +1 @@ +- Fix cancel/reset button tooltip going off-screen 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; |