aboutsummaryrefslogtreecommitdiff
path: root/src/client/java/dev/isxander/yacl/gui/controllers/slider
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/java/dev/isxander/yacl/gui/controllers/slider')
-rw-r--r--src/client/java/dev/isxander/yacl/gui/controllers/slider/SliderControllerElement.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/client/java/dev/isxander/yacl/gui/controllers/slider/SliderControllerElement.java b/src/client/java/dev/isxander/yacl/gui/controllers/slider/SliderControllerElement.java
index c78e0eb..ea4e262 100644
--- a/src/client/java/dev/isxander/yacl/gui/controllers/slider/SliderControllerElement.java
+++ b/src/client/java/dev/isxander/yacl/gui/controllers/slider/SliderControllerElement.java
@@ -141,7 +141,11 @@ public class SliderControllerElement extends ControllerWidget<ISliderController<
@Override
public void setDimension(Dimension<Integer> dim) {
super.setDimension(dim);
- sliderBounds = Dimension.ofInt(dim.xLimit() - getXPadding() - getThumbWidth() / 2 - dim.width() / 3, dim.centerY() - 5, dim.width() / 3, 10);
+ int trackWidth = dim.width() / 3;
+ if (optionNameString.isEmpty())
+ trackWidth = dim.width() / 2;
+
+ sliderBounds = Dimension.ofInt(dim.xLimit() - getXPadding() - getThumbWidth() / 2 - trackWidth, dim.centerY() - 5, trackWidth, 10);
}
protected int getThumbX() {