aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorSturmlilie <jonas.kulla@alumni.fh-aachen.de>2020-11-07 19:56:26 +0100
committerGitHub <noreply@github.com>2020-11-07 20:56:26 +0200
commitdac5dcefaf585b77822f31a1b4b1f3cb97dcff96 (patch)
tree60533c03026cf4350e1b060c6a5a4ec0c3ac8c6b /src/main
parent079affc72f727aec82e57fa65d0fddc2aa43b15d (diff)
downloadLibGui-dac5dcefaf585b77822f31a1b4b1f3cb97dcff96.tar.gz
LibGui-dac5dcefaf585b77822f31a1b4b1f3cb97dcff96.tar.bz2
LibGui-dac5dcefaf585b77822f31a1b4b1f3cb97dcff96.zip
WScrollBar: Allow mousewheel scrolling (#90)3.2.2
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/io/github/cottonmc/cotton/gui/widget/WScrollBar.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/main/java/io/github/cottonmc/cotton/gui/widget/WScrollBar.java b/src/main/java/io/github/cottonmc/cotton/gui/widget/WScrollBar.java
index cfcdfc1..500f312 100644
--- a/src/main/java/io/github/cottonmc/cotton/gui/widget/WScrollBar.java
+++ b/src/main/java/io/github/cottonmc/cotton/gui/widget/WScrollBar.java
@@ -214,6 +214,12 @@ public class WScrollBar extends WWidget {
}
}
+ @Environment(EnvType.CLIENT)
+ @Override
+ public void onMouseScroll(int x, int y, double amount) {
+ setValue(getValue() + (int) -amount);
+ }
+
public int getValue() {
return value;
}