Skip to content

Commit 2ffdf3e

Browse files
committed
Fix cancel/reset button tooltip going off-screen
1 parent 22fa084 commit 2ffdf3e

3 files changed

Lines changed: 4 additions & 2 deletions

File tree

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ plugins {
1616
val ciRun = System.getenv().containsKey("GITHUB_ACTIONS")
1717

1818
group = "dev.isxander"
19-
version = "1.4.1"
19+
version = "1.4.2"
2020

2121
if (ciRun)
2222
version = "$version-SNAPSHOT"

changelogs/1.4.2.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- Fix cancel/reset button tooltip going off-screen

src/main/java/dev/isxander/yacl/gui/YACLScreen.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import net.minecraft.client.util.math.MatrixStack;
1313
import net.minecraft.text.Text;
1414
import net.minecraft.util.Formatting;
15+
import net.minecraft.util.math.MathHelper;
1516
import net.minecraft.util.math.Matrix4f;
1617

1718
import java.util.HashSet;
@@ -230,7 +231,7 @@ public static void renderMultilineTooltip(MatrixStack matrices, TextRenderer tex
230231
if (maxBelow < -8)
231232
y = maxBelow > minAbove ? belowY : aboveY;
232233

233-
int x = centerX - text.getMaxWidth() / 2 - 12;
234+
int x = Math.max(centerX - text.getMaxWidth() / 2 - 12, -6);
234235

235236
int drawX = x + 12;
236237
int drawY = y - 12;

0 commit comments

Comments
 (0)