From 5c7c3d0f5ca04df48c2b8f054a662300e9f0d14b Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Thu, 17 Jun 2021 00:31:22 -0400 Subject: Fix edit location buttons not having correct hitbox --- src/main/java/me/Danker/gui/buttons/LocationButton.java | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/main/java/me/Danker/gui/buttons/LocationButton.java b/src/main/java/me/Danker/gui/buttons/LocationButton.java index f328c58..8da1ab9 100644 --- a/src/main/java/me/Danker/gui/buttons/LocationButton.java +++ b/src/main/java/me/Danker/gui/buttons/LocationButton.java @@ -40,24 +40,19 @@ public class LocationButton extends GuiButton { } this.longestText = longestText; + int offset = text2Offset == null ? 0 : text2Offset; this.height = (int) ((splitText.length * 9 + 3) * scale); - this.width = (int) ((this.longestText + 3) * scale); + this.width = (int) ((this.longestText + offset + 3) * scale); } @Override public void drawButton(Minecraft mc, int mouseX, int mouseY) { - if (text2 == null) { - drawRect(x - 2, y - 2, x + width, y + height, 0x40D3D3D3); - } else { - drawRect(x - 2, y - 2, (int) (x + (longestText + text2Offset + 3) * scale), y + height, 0x40D3D3D3); - new TextRenderer(mc, text2, (int) (x + (text2Offset * scale)), y, scale); - } + drawRect(x - 2, y - 2, x + width, y + height, 0x40D3D3D3); + if (text2 != null) new TextRenderer(mc, text2, (int) (x + (text2Offset * scale)), y, scale); new TextRenderer(mc, text, x, y, scale); } @Override - public void playPressSound(SoundHandler soundHandler) { - - } + public void playPressSound(SoundHandler soundHandler) {} } -- cgit