From b234590bab2866cda0ce3b48aba0206e3c4ce198 Mon Sep 17 00:00:00 2001 From: Juuxel <6596629+Juuxel@users.noreply.github.com> Date: Wed, 20 May 2020 20:53:59 +0300 Subject: Set the max value of scroll bars be at least the window --- src/main/java/io/github/cottonmc/cotton/gui/widget/WScrollBar.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') 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 2acfb80..e940327 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 @@ -132,7 +132,7 @@ public class WScrollBar extends WAbstractSlider { } public void setMaxValue(int max) { - super.setMaxValue(max - window); + super.setMaxValue(Math.max(max - window, window)); } public int getWindow() { -- cgit