diff options
author | Juuxel <6596629+Juuxel@users.noreply.github.com> | 2020-05-08 21:52:22 +0300 |
---|---|---|
committer | Juuxel <6596629+Juuxel@users.noreply.github.com> | 2020-05-08 21:52:22 +0300 |
commit | 3642230cc2fa592d6ca6800a1092a53f979c1d95 (patch) | |
tree | fd1a36d8cd00ffc8b6e13cf4d7603f43d5ae9480 | |
parent | 1046028cffb66f2993ea0dfb72c15b24bccc8995 (diff) | |
download | LibGui-3642230cc2fa592d6ca6800a1092a53f979c1d95.tar.gz LibGui-3642230cc2fa592d6ca6800a1092a53f979c1d95.tar.bz2 LibGui-3642230cc2fa592d6ca6800a1092a53f979c1d95.zip |
Fix slider thumbs rendering 1 pixel to the right
-rw-r--r-- | src/main/java/io/github/cottonmc/cotton/gui/widget/WSlider.java | 2 |
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; |