diff options
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/io/github/cottonmc/cotton/gui/widget/WAbstractSlider.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/main/java/io/github/cottonmc/cotton/gui/widget/WAbstractSlider.java b/src/main/java/io/github/cottonmc/cotton/gui/widget/WAbstractSlider.java index 7079256..a086b3a 100644 --- a/src/main/java/io/github/cottonmc/cotton/gui/widget/WAbstractSlider.java +++ b/src/main/java/io/github/cottonmc/cotton/gui/widget/WAbstractSlider.java @@ -220,10 +220,18 @@ public abstract class WAbstractSlider extends WWidget { public void setMinValue(int min) { this.min = min; + if (this.value < min) { + this.value = min; + onValueChanged(this.value); + } } public void setMaxValue(int max) { this.max = max; + if (this.value > max) { + this.value = max; + onValueChanged(this.value); + } } public Axis getAxis() { |