diff options
author | Sturmlilie <jonas.kulla@alumni.fh-aachen.de> | 2020-11-07 19:56:26 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-07 20:56:26 +0200 |
commit | dac5dcefaf585b77822f31a1b4b1f3cb97dcff96 (patch) | |
tree | 60533c03026cf4350e1b060c6a5a4ec0c3ac8c6b | |
parent | 079affc72f727aec82e57fa65d0fddc2aa43b15d (diff) | |
download | LibGui-dac5dcefaf585b77822f31a1b4b1f3cb97dcff96.tar.gz LibGui-dac5dcefaf585b77822f31a1b4b1f3cb97dcff96.tar.bz2 LibGui-dac5dcefaf585b77822f31a1b4b1f3cb97dcff96.zip |
WScrollBar: Allow mousewheel scrolling (#90)3.2.2
-rw-r--r-- | src/main/java/io/github/cottonmc/cotton/gui/widget/WScrollBar.java | 6 |
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; } |