From 9129362da6dd1c1f42b83a9cfab0463b59d0c774 Mon Sep 17 00:00:00 2001 From: Juuxel <6596629+Juuxel@users.noreply.github.com> Date: Tue, 2 Feb 2021 17:51:15 +0200 Subject: WScrollBar: Increase scrolling speed by 4x --- src/main/java/io/github/cottonmc/cotton/gui/widget/WScrollBar.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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; } -- cgit