aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authorJuuxel <6596629+Juuxel@users.noreply.github.com>2020-05-08 21:52:22 +0300
committerJuuxel <6596629+Juuxel@users.noreply.github.com>2020-05-08 21:52:22 +0300
commit3642230cc2fa592d6ca6800a1092a53f979c1d95 (patch)
treefd1a36d8cd00ffc8b6e13cf4d7603f43d5ae9480 /src/main/java
parent1046028cffb66f2993ea0dfb72c15b24bccc8995 (diff)
downloadLibGui-3642230cc2fa592d6ca6800a1092a53f979c1d95.tar.gz
LibGui-3642230cc2fa592d6ca6800a1092a53f979c1d95.tar.bz2
LibGui-3642230cc2fa592d6ca6800a1092a53f979c1d95.zip
Fix slider thumbs rendering 1 pixel to the right
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/io/github/cottonmc/cotton/gui/widget/WSlider.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/main/java/io/github/cottonmc/cotton/gui/widget/WSlider.java b/src/main/java/io/github/cottonmc/cotton/gui/widget/WSlider.java
index 5934997..f68c5bb 100644
--- a/src/main/java/io/github/cottonmc/cotton/gui/widget/WSlider.java
+++ b/src/main/java/io/github/cottonmc/cotton/gui/widget/WSlider.java
@@ -73,7 +73,7 @@ public class WSlider extends WAbstractSlider {
} else {
int trackY = y + height / 2 - TRACK_WIDTH / 2;
thumbX = direction == Direction.LEFT
- ? (width - THUMB_SIZE) + 1 - (int) (coordToValueRatio * (value - min))
+ ? (width - THUMB_SIZE) - (int) (coordToValueRatio * (value - min))
: Math.round(coordToValueRatio * (value - min));
thumbY = height / 2 - THUMB_SIZE / 2;
thumbXOffset = 8;