From 272837528c7bf23e7e289d46fb4510d06102cca7 Mon Sep 17 00:00:00 2001 From: Juuxel <6596629+Juuxel@users.noreply.github.com> Date: Thu, 26 Nov 2020 18:24:33 +0200 Subject: Fix labeled slider painting weirdness --- .../java/io/github/cottonmc/cotton/gui/widget/WLabeledSlider.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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(); } -- cgit