diff options
author | Juuxel <6596629+Juuxel@users.noreply.github.com> | 2020-11-26 18:24:33 +0200 |
---|---|---|
committer | Juuxel <6596629+Juuxel@users.noreply.github.com> | 2020-11-26 18:24:33 +0200 |
commit | 272837528c7bf23e7e289d46fb4510d06102cca7 (patch) | |
tree | c16cb2d66fa8d2d9cc1b4de4b0e39a2adfc24c2f | |
parent | aa73fb203aacd3f150b1d52346cde514237cdef1 (diff) | |
download | LibGui-272837528c7bf23e7e289d46fb4510d06102cca7.tar.gz LibGui-272837528c7bf23e7e289d46fb4510d06102cca7.tar.bz2 LibGui-272837528c7bf23e7e289d46fb4510d06102cca7.zip |
Fix labeled slider painting weirdness
-rw-r--r-- | src/main/java/io/github/cottonmc/cotton/gui/widget/WLabeledSlider.java | 4 |
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(); } |