From 680e4707653e22e60bc3f8e22eb8603a65bf2991 Mon Sep 17 00:00:00 2001 From: Juuxel <6596629+Juuxel@users.noreply.github.com> Date: Tue, 30 Jun 2020 20:24:33 +0300 Subject: Fix #68 --- .../github/cottonmc/cotton/gui/client/CottonInventoryScreen.java | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src') 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 4287565..4b7a726 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 @@ -69,6 +69,13 @@ public class CottonInventoryScreen extends Handl reposition(screenWidth, screenHeight); } + /** + * Clears the heavyweight peers of this screen's GUI description. + */ + private void clearPeers() { + description.slots.clear(); + } + /** * Repositions the root panel. * @@ -78,6 +85,7 @@ public class CottonInventoryScreen extends Handl protected void reposition(int screenWidth, int screenHeight) { WPanel basePanel = description.getRootPanel(); if (basePanel!=null) { + clearPeers(); basePanel.validate(description); backgroundWidth = basePanel.getWidth(); -- cgit