aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuuxel <6596629+Juuxel@users.noreply.github.com>2021-02-02 17:51:32 +0200
committerJuuxel <6596629+Juuxel@users.noreply.github.com>2021-02-02 17:52:25 +0200
commit2588e014d5c647ee62021369b9831adae4b7c7a0 (patch)
treeff345f8e12177ea27b596a954afacd65c95d9083
parent9129362da6dd1c1f42b83a9cfab0463b59d0c774 (diff)
downloadLibGui-2588e014d5c647ee62021369b9831adae4b7c7a0.tar.gz
LibGui-2588e014d5c647ee62021369b9831adae4b7c7a0.tar.bz2
LibGui-2588e014d5c647ee62021369b9831adae4b7c7a0.zip
WListPanel: Add mouse scrolling support
-rw-r--r--src/main/java/io/github/cottonmc/cotton/gui/widget/WListPanel.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/main/java/io/github/cottonmc/cotton/gui/widget/WListPanel.java b/src/main/java/io/github/cottonmc/cotton/gui/widget/WListPanel.java
index 2ddc6f1..e83d891 100644
--- a/src/main/java/io/github/cottonmc/cotton/gui/widget/WListPanel.java
+++ b/src/main/java/io/github/cottonmc/cotton/gui/widget/WListPanel.java
@@ -5,6 +5,7 @@ import net.fabricmc.api.Environment;
import net.minecraft.client.util.math.MatrixStack;
import io.github.cottonmc.cotton.gui.widget.data.Axis;
+import io.github.cottonmc.cotton.gui.widget.data.InputResult;
import java.util.ArrayList;
import java.util.HashMap;
@@ -196,4 +197,9 @@ public class WListPanel<D, W extends WWidget> extends WClippedPanel {
fixedHeight = true;
return this;
}
+
+ @Override
+ public InputResult onMouseScroll(int x, int y, double amount) {
+ return scrollBar.onMouseScroll(0, 0, amount);
+ }
}