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 ac5ddcbe..d565d123 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 @@ -15,8 +15,14 @@ public class WScrollBar extends WWidget { private static final Identifier FOCUS_TEXTURE = new Identifier(LibGuiCommon.MOD_ID, "widget/scroll_bar/focus"); + + /** + * The default {@linkplain #getScrollingSpeed() scrolling speed for mouse inputs}. + * + * @since 9.0.0 + */ public static final int DEFAULT_SCROLLING_SPEED = 4; - private int scrollingSpeed = 4; + private int scrollingSpeed = DEFAULT_SCROLLING_SPEED; protected Axis axis = Axis.HORIZONTAL; protected int value; @@ -229,24 +235,25 @@ public WScrollBar setMaxValue(int max) { } /** - * Sets the mouse scroll speed; - *

- * Default value: {@value #DEFAULT_SCROLLING_SPEED} - * @param scrollingSpeed the scroll speed + * Sets the mouse scroll speed. + * + *

By default, the scrolling speed is {@value #DEFAULT_SCROLLING_SPEED}. + * + * @param scrollingSpeed the scroll speed, must be positive * @return this scroll bar */ public WScrollBar setScrollingSpeed(int scrollingSpeed) { - if(scrollingSpeed < 0) throw new IllegalArgumentException("Negative value for scrolling speed"); - if(scrollingSpeed == 0) throw new IllegalArgumentException("Zero value for scrolling speed"); + if (scrollingSpeed < 0) throw new IllegalArgumentException("Negative value for scrolling speed"); + if (scrollingSpeed == 0) throw new IllegalArgumentException("Zero value for scrolling speed"); this.scrollingSpeed = scrollingSpeed; return this; } /** - * Gets the mouse scroll speed; - *

- * Default value: {@value #DEFAULT_SCROLLING_SPEED} + * {@return the default mouse scroll speed} + * + *

By default, the scrolling speed is {@value #DEFAULT_SCROLLING_SPEED}. */ public int getScrollingSpeed() { return scrollingSpeed;