From 8ac79459a13a59bd97568ad05b11e13ad4d9f30d Mon Sep 17 00:00:00 2001 From: Juuz <6596629+Juuxel@users.noreply.github.com> Date: Sat, 18 Nov 2023 20:46:23 +0200 Subject: Fix Screen.renderBackground being called twice Fixes #226. --- .../java/io/github/cottonmc/cotton/gui/client/CottonClientScreen.java | 2 -- .../io/github/cottonmc/cotton/gui/client/CottonInventoryScreen.java | 2 -- 2 files changed, 4 deletions(-) (limited to 'src/main/java/io') 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 071bb39..9e47c40 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 @@ -124,8 +124,6 @@ public class CottonClientScreen extends Screen implements CottonScreenImpl { } private void paint(DrawContext context, int mouseX, int mouseY, float delta) { - renderBackground(context, mouseX, mouseY, delta); - if (description!=null) { context.getMatrices().push(); context.getMatrices().translate(0f, 0f, 0.01f); 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 06f7e3f..701380d 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 @@ -276,8 +276,6 @@ public class CottonInventoryScreen extends Handl protected void drawBackground(DrawContext context, float partialTicks, int mouseX, int mouseY) {} //This is just an AbstractContainerScreen thing; most Screens don't work this way. private void paint(DrawContext context, int mouseX, int mouseY, float delta) { - renderBackground(context, mouseX, mouseY, delta); - if (description!=null) { WPanel root = description.getRootPanel(); if (root!=null) { -- cgit