diff options
author | Juuxel <6596629+Juuxel@users.noreply.github.com> | 2021-02-02 17:51:15 +0200 |
---|---|---|
committer | Juuxel <6596629+Juuxel@users.noreply.github.com> | 2021-02-02 17:51:15 +0200 |
commit | 9129362da6dd1c1f42b83a9cfab0463b59d0c774 (patch) | |
tree | d9a2695804be88f257c7548c7e6389096a9dd1b1 | |
parent | 10772b146ff6af263c9c073028f85d34477b5d08 (diff) | |
download | LibGui-9129362da6dd1c1f42b83a9cfab0463b59d0c774.tar.gz LibGui-9129362da6dd1c1f42b83a9cfab0463b59d0c774.tar.bz2 LibGui-9129362da6dd1c1f42b83a9cfab0463b59d0c774.zip |
WScrollBar: Increase scrolling speed by 4x
-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 ea23953..e4738f6 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; @@ -221,7 +223,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; } |