aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJuuxel <6596629+Juuxel@users.noreply.github.com>2020-11-26 18:24:33 +0200
committerJuuxel <6596629+Juuxel@users.noreply.github.com>2020-11-26 18:24:33 +0200
commit272837528c7bf23e7e289d46fb4510d06102cca7 (patch)
treec16cb2d66fa8d2d9cc1b4de4b0e39a2adfc24c2f /src
parentaa73fb203aacd3f150b1d52346cde514237cdef1 (diff)
downloadLibGui-272837528c7bf23e7e289d46fb4510d06102cca7.tar.gz
LibGui-272837528c7bf23e7e289d46fb4510d06102cca7.tar.bz2
LibGui-272837528c7bf23e7e289d46fb4510d06102cca7.zip
Fix labeled slider painting weirdness
Diffstat (limited to 'src')
-rw-r--r--src/main/java/io/github/cottonmc/cotton/gui/widget/WLabeledSlider.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/main/java/io/github/cottonmc/cotton/gui/widget/WLabeledSlider.java b/src/main/java/io/github/cottonmc/cotton/gui/widget/WLabeledSlider.java
index e7f7e3a..fa1b49e 100644
--- a/src/main/java/io/github/cottonmc/cotton/gui/widget/WLabeledSlider.java
+++ b/src/main/java/io/github/cottonmc/cotton/gui/widget/WLabeledSlider.java
@@ -166,7 +166,8 @@ public class WLabeledSlider extends WAbstractSlider {
: (direction == Direction.UP ? height - mouseY : mouseY);
int rotMouseY = axis == Axis.HORIZONTAL ? mouseY : mouseX;
- RenderSystem.pushMatrix();
+ RenderSystem.pushMatrix(); // TODO: Get rid of this eventually
+ matrices.push();
matrices.translate(x, y, 0);
if (axis == Axis.VERTICAL) {
RenderSystem.translatef(0, height, 0);
@@ -193,6 +194,7 @@ public class WLabeledSlider extends WAbstractSlider {
int color = isMouseInsideBounds(mouseX, mouseY) ? 0xFFFFA0 : 0xE0E0E0;
ScreenDrawing.drawStringWithShadow(matrices, label.asOrderedText(), labelAlignment, 2, aHeight / 2 - 4, aWidth - 4, color);
}
+ matrices.pop();
RenderSystem.popMatrix();
}