From d1e1182646750f32d2339197ff737ab570e47262 Mon Sep 17 00:00:00 2001 From: tanishisherewithhh <120117618+tanishisherewithhh@users.noreply.github.com> Date: Fri, 20 Sep 2024 12:40:56 +0530 Subject: [PATCH] Scrolling not showing settings completely. --- .../java/dev/heliosclient/ui/clickgui/CategoryPane.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/dev/heliosclient/ui/clickgui/CategoryPane.java b/src/main/java/dev/heliosclient/ui/clickgui/CategoryPane.java index efbda2e..deb3d68 100644 --- a/src/main/java/dev/heliosclient/ui/clickgui/CategoryPane.java +++ b/src/main/java/dev/heliosclient/ui/clickgui/CategoryPane.java @@ -150,8 +150,8 @@ public void update(float delta) { scrollVelocity *= Math.pow(0.95, timeDelta * 60); // Decay factor // Ensure scroll offset stays within bounds - currentScrollOffset = MathHelper.clamp(currentScrollOffset, 0,height - hudBox.getHeight()); - targetScrollOffset = MathHelper.clamp(targetScrollOffset, 0,height - hudBox.getHeight()); + currentScrollOffset = MathHelper.clamp(currentScrollOffset, 0, hudBox.getHeight()); + targetScrollOffset = MathHelper.clamp(targetScrollOffset, 0, hudBox.getHeight()); // Update the actual scroll offset scrollOffset = (int) currentScrollOffset; @@ -224,8 +224,8 @@ public void render(DrawContext drawContext, int mouseX, int mouseY, float delta, int settingsHeight = m.renderSettings(drawContext, x, buttonYOffset, mouseX, mouseY, textRenderer); buttonYOffset += settingsHeight; + MAX_HEIGHT += settingsHeight; - MAX_HEIGHT = settingsHeight + MAX_HEIGHT; buttonYOffset += ModuleButton.height + 3; } @@ -328,7 +328,7 @@ public void mouseScrolled(int mouseX, int mouseY, double amount) { if (hoveredOverModules(mouseX, mouseY) && ClickGUI.ScrollTypes.values()[HeliosClient.CLICKGUI.ScrollType.value] == ClickGUI.ScrollTypes.NEW) { // Update target scroll offset targetScrollOffset -= amount * HeliosClient.CLICKGUI.ScrollSpeed.value; - targetScrollOffset = MathHelper.clamp(targetScrollOffset, 0,height - hudBox.getHeight()); + targetScrollOffset = MathHelper.clamp(targetScrollOffset, 0,hudBox.getHeight()); // Add to velocity (for momentum) scrollVelocity -= amount * HeliosClient.CLICKGUI.ScrollSpeed.value * 0.5;