diff options
author | Juuxel <kasperi.kauppi@gmail.com> | 2020-06-18 12:15:14 +0300 |
---|---|---|
committer | Juuxel <kasperi.kauppi@gmail.com> | 2020-06-18 12:15:14 +0300 |
commit | 722c3cb442c7b5e751132f0a812d2fc771d304d5 (patch) | |
tree | 7fec0142cdcd6404d49f5ed01582eaec08ff6740 /src | |
parent | 0d5c959941448f4ebf7fadc312f4136ef3ecd7a5 (diff) | |
download | LibGui-722c3cb442c7b5e751132f0a812d2fc771d304d5.tar.gz LibGui-722c3cb442c7b5e751132f0a812d2fc771d304d5.tar.bz2 LibGui-722c3cb442c7b5e751132f0a812d2fc771d304d5.zip |
Fix dirty GL scissors being used when the screen applies no other scissors
Diffstat (limited to 'src')
3 files changed, 3 insertions, 1 deletions
diff --git a/src/main/java/io/github/cottonmc/cotton/gui/client/CottonClientScreen.java b/src/main/java/io/github/cottonmc/cotton/gui/client/CottonClientScreen.java index 81ff65a..7c7d7d9 100644 --- a/src/main/java/io/github/cottonmc/cotton/gui/client/CottonClientScreen.java +++ b/src/main/java/io/github/cottonmc/cotton/gui/client/CottonClientScreen.java @@ -65,6 +65,7 @@ public class CottonClientScreen extends Screen implements TextHoverRendererScree WPanel root = description.getRootPanel(); if (root!=null) { GL11.glEnable(GL11.GL_SCISSOR_TEST); + Scissors.refreshScissors(); root.paint(matrices, left, top, mouseX-left, mouseY-top); GL11.glDisable(GL11.GL_SCISSOR_TEST); Scissors.checkStackIsEmpty(); diff --git a/src/main/java/io/github/cottonmc/cotton/gui/client/CottonInventoryScreen.java b/src/main/java/io/github/cottonmc/cotton/gui/client/CottonInventoryScreen.java index b758a97..7ada7bd 100644 --- a/src/main/java/io/github/cottonmc/cotton/gui/client/CottonInventoryScreen.java +++ b/src/main/java/io/github/cottonmc/cotton/gui/client/CottonInventoryScreen.java @@ -224,6 +224,7 @@ public class CottonInventoryScreen<T extends SyncedGuiDescription> extends Handl WPanel root = description.getRootPanel(); if (root!=null) { GL11.glEnable(GL11.GL_SCISSOR_TEST); + Scissors.refreshScissors(); root.paint(matrices, x, y, mouseX-x, mouseY-y); GL11.glDisable(GL11.GL_SCISSOR_TEST); Scissors.checkStackIsEmpty(); diff --git a/src/main/java/io/github/cottonmc/cotton/gui/client/Scissors.java b/src/main/java/io/github/cottonmc/cotton/gui/client/Scissors.java index a8f65c8..4998a05 100644 --- a/src/main/java/io/github/cottonmc/cotton/gui/client/Scissors.java +++ b/src/main/java/io/github/cottonmc/cotton/gui/client/Scissors.java @@ -51,7 +51,7 @@ public final class Scissors { refreshScissors(); } - private static void refreshScissors() { + static void refreshScissors() { MinecraftClient mc = MinecraftClient.getInstance(); if (STACK.isEmpty()) { |