diff options
author | isXander <xander@isxander.dev> | 2023-05-29 07:08:06 +0100 |
---|---|---|
committer | isXander <xander@isxander.dev> | 2023-05-29 07:08:06 +0100 |
commit | a218b6fcf4953b12266d6b2406373ff72941b3c9 (patch) | |
tree | 7bba8aeccfb32f992be284e9a005064a9309f71e /common/src | |
parent | fbc37f1d2e976867c8b3ebcebe988b3b02f475dc (diff) | |
download | YetAnotherConfigLib-a218b6fcf4953b12266d6b2406373ff72941b3c9.tar.gz YetAnotherConfigLib-a218b6fcf4953b12266d6b2406373ff72941b3c9.tar.bz2 YetAnotherConfigLib-a218b6fcf4953b12266d6b2406373ff72941b3c9.zip |
Fix option list entries sometimes rendering over the navbar
Diffstat (limited to 'common/src')
-rw-r--r-- | common/src/main/java/dev/isxander/yacl/gui/tab/ScrollableNavigationBar.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/common/src/main/java/dev/isxander/yacl/gui/tab/ScrollableNavigationBar.java b/common/src/main/java/dev/isxander/yacl/gui/tab/ScrollableNavigationBar.java index 17d53b8..8132ccc 100644 --- a/common/src/main/java/dev/isxander/yacl/gui/tab/ScrollableNavigationBar.java +++ b/common/src/main/java/dev/isxander/yacl/gui/tab/ScrollableNavigationBar.java @@ -3,6 +3,7 @@ package dev.isxander.yacl.gui.tab; import com.google.common.collect.ImmutableList; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.Font; +import net.minecraft.client.gui.GuiGraphics; import net.minecraft.client.gui.components.AbstractWidget; import net.minecraft.client.gui.components.TabButton; import net.minecraft.client.gui.components.events.GuiEventListener; @@ -53,6 +54,17 @@ public class ScrollableNavigationBar extends TabNavigationBar { } @Override + public void render(GuiGraphics graphics, int mouseX, int mouseY, float delta) { + graphics.pose().pushPose(); + // render option list BELOW the navbar without need to scissor + graphics.pose().translate(0, 0, 10); + + super.render(graphics, mouseX, mouseY, delta); + + graphics.pose().popPose(); + } + + @Override public boolean mouseScrolled(double mouseX, double mouseY, double amount) { this.setScrollOffset(this.scrollOffset - (int)(amount*10)); return true; |