diff options
author | Juuxel <6596629+Juuxel@users.noreply.github.com> | 2021-02-27 16:52:21 +0200 |
---|---|---|
committer | Juuxel <6596629+Juuxel@users.noreply.github.com> | 2021-02-27 16:52:21 +0200 |
commit | a9c44d2153b939dfaaffb2eb0a35e8445abf9c35 (patch) | |
tree | 9762e75757f9022065693f662bde1cdfc7c11555 /src/main/java | |
parent | 17d4db2dd9f43dee7f5357b0b2e133749f165e7c (diff) | |
download | LibGui-a9c44d2153b939dfaaffb2eb0a35e8445abf9c35.tar.gz LibGui-a9c44d2153b939dfaaffb2eb0a35e8445abf9c35.tar.bz2 LibGui-a9c44d2153b939dfaaffb2eb0a35e8445abf9c35.zip |
WScrollBar: Increase scrolling speed by 4x
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/io/github/cottonmc/cotton/gui/widget/WScrollBar.java | 4 |
1 files changed, 3 insertions, 1 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 c08e141..0eb7818 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 @@ -10,6 +10,8 @@ import io.github.cottonmc.cotton.gui.widget.data.Axis; import io.github.cottonmc.cotton.gui.widget.data.InputResult; public class WScrollBar extends WWidget { + private static final int SCROLLING_SPEED = 4; + protected Axis axis = Axis.HORIZONTAL; protected int value; protected int maxValue = 100; @@ -219,7 +221,7 @@ public class WScrollBar extends WWidget { @Environment(EnvType.CLIENT) @Override public InputResult onMouseScroll(int x, int y, double amount) { - setValue(getValue() + (int) -amount); + setValue(getValue() + (int) -amount * SCROLLING_SPEED); return InputResult.PROCESSED; } |