From 095d7f405c07a04d04f35be0097f8ca0978c477b Mon Sep 17 00:00:00 2001 From: Goodbird Date: Wed, 3 Jan 2024 21:40:43 +0300 Subject: [PATCH] Fixed textured rects hover hitbox not changing with rescale --- .../client/gui/custom/components/CustomGuiTexturedRect.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/noppes/npcs/client/gui/custom/components/CustomGuiTexturedRect.java b/src/main/java/noppes/npcs/client/gui/custom/components/CustomGuiTexturedRect.java index 45eb9a332..e0c9940c2 100644 --- a/src/main/java/noppes/npcs/client/gui/custom/components/CustomGuiTexturedRect.java +++ b/src/main/java/noppes/npcs/client/gui/custom/components/CustomGuiTexturedRect.java @@ -63,7 +63,7 @@ public class CustomGuiTexturedRect extends Gui implements IGuiComponent { } public void onRender(Minecraft mc, int mouseX, int mouseY, int mouseWheel, float partialTicks) { - boolean hovered = mouseX >= this.x + GuiCustom.guiLeft && mouseY >= this.y + GuiCustom.guiTop && mouseX < this.x + GuiCustom.guiLeft + this.width && mouseY < this.y + GuiCustom.guiTop + this.height; + boolean hovered = mouseX >= this.x + GuiCustom.guiLeft && mouseY >= this.y + GuiCustom.guiTop && mouseX < this.x + GuiCustom.guiLeft + this.width*scale && mouseY < this.y + GuiCustom.guiTop + this.height*scale; if (this.imageData != null && this.imageData.imageLoaded()) { int totalWidth = this.imageData.getTotalWidth();