aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuuxel <6596629+Juuxel@users.noreply.github.com>2021-01-31 16:08:58 +0200
committerJuuxel <6596629+Juuxel@users.noreply.github.com>2021-01-31 16:08:58 +0200
commit124eab73545d49b9a5188f09f7cb32714af49b1e (patch)
treea98374eb049646a78158a5ed59986561109c0e13
parentf8909f14f02e36460c93d95e1b7b5bba1751aa82 (diff)
downloadLibGui-124eab73545d49b9a5188f09f7cb32714af49b1e.tar.gz
LibGui-124eab73545d49b9a5188f09f7cb32714af49b1e.tar.bz2
LibGui-124eab73545d49b9a5188f09f7cb32714af49b1e.zip
Revert "(Hackily) Fix bug with REI overlapping with LibGui screens"
This is not needed on 4.0 because of the Insets class. This reverts commit 1a5d29ec
-rw-r--r--src/main/java/io/github/cottonmc/cotton/gui/client/CottonInventoryScreen.java12
1 files changed, 4 insertions, 8 deletions
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 f6c1429..d5e42c1 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
@@ -110,12 +110,8 @@ public class CottonInventoryScreen<T extends SyncedGuiDescription> extends Handl
clearPeers();
basePanel.validate(description);
- // This is needed for REI; otherwise it'll overlap.
- // 8 = the padding of BackgroundPainter.VANILLA
- int padding = 2 * 8; // TODO: This is awful and bad and should be removed ASAP
-
- backgroundWidth = basePanel.getWidth() + padding;
- backgroundHeight = basePanel.getHeight() + padding;
+ backgroundWidth = basePanel.getWidth();
+ backgroundHeight = basePanel.getHeight();
//DEBUG
if (backgroundWidth<16) backgroundWidth=300;
@@ -123,8 +119,8 @@ public class CottonInventoryScreen<T extends SyncedGuiDescription> extends Handl
}
if (!description.isFullscreen()) {
- x = (screenWidth / 2) - (backgroundWidth / 2);
- y = (screenHeight / 2) - (backgroundHeight / 2);
+ x = (width / 2) - (backgroundWidth / 2);
+ y = (height / 2) - (backgroundHeight / 2);
titleX = 0;
titleY = 0;
} else {