From d2f297184c841757ae5c120369a170173ca3ab8f Mon Sep 17 00:00:00 2001 From: noil Date: Sun, 27 Oct 2019 15:54:17 -0400 Subject: [PATCH] HubComponent now checks for dragging only inside the title-bar area --- .../seppuku/impl/gui/hud/component/HubComponent.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/java/me/rigamortis/seppuku/impl/gui/hud/component/HubComponent.java b/src/main/java/me/rigamortis/seppuku/impl/gui/hud/component/HubComponent.java index 379570b..f879c13 100644 --- a/src/main/java/me/rigamortis/seppuku/impl/gui/hud/component/HubComponent.java +++ b/src/main/java/me/rigamortis/seppuku/impl/gui/hud/component/HubComponent.java @@ -53,6 +53,12 @@ public final class HubComponent extends DraggableHudComponent { // Scrolling this.handleScrolling(mouseX, mouseY); + // No dragging inside box + final boolean insideTitlebar = mouseY <= this.getY() + BORDER + Minecraft.getMinecraft().fontRenderer.FONT_HEIGHT + 1; + if (!insideTitlebar) { + this.setDragging(false); + } + // Background & title RenderUtil.drawRect(this.getX(), this.getY(), this.getX() + this.getW(), this.getY() + this.getH(), 0xFF202020); mc.fontRenderer.drawStringWithShadow(this.getName(), this.getX() + 2, this.getY() + 2, 0xFFFFFFFF);