Skip to content

Commit

Permalink
Scrolling not showing settings completely.
Browse files Browse the repository at this point in the history
  • Loading branch information
tanishisherewithhh committed Sep 20, 2024
1 parent ab4e326 commit d1e1182
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main/java/dev/heliosclient/ui/clickgui/CategoryPane.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit d1e1182

Please sign in to comment.