aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authorJuuxel <6596629+Juuxel@users.noreply.github.com>2020-12-21 18:36:37 +0200
committerJuuxel <6596629+Juuxel@users.noreply.github.com>2020-12-21 18:36:37 +0200
commit1a5d29ec80508226df942746e6629d1f276c57be (patch)
treeb1b0e541e8c297cb132d2eae2b472cab78d2c120 /src/main/java
parentea894bba3b8056740af61635139023ccf0756ded (diff)
downloadLibGui-1a5d29ec80508226df942746e6629d1f276c57be.tar.gz
LibGui-1a5d29ec80508226df942746e6629d1f276c57be.tar.bz2
LibGui-1a5d29ec80508226df942746e6629d1f276c57be.zip
(Hackily) Fix bug with REI overlapping with LibGui screens3.3.2
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/io/github/cottonmc/cotton/gui/client/CottonInventoryScreen.java12
1 files changed, 8 insertions, 4 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 6ae53d0..370bb68 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
@@ -97,8 +97,12 @@ public class CottonInventoryScreen<T extends SyncedGuiDescription> extends Handl
clearPeers();
basePanel.validate(description);
- backgroundWidth = basePanel.getWidth();
- backgroundHeight = basePanel.getHeight();
+ // 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;
//DEBUG
if (backgroundWidth<16) backgroundWidth=300;
@@ -106,8 +110,8 @@ public class CottonInventoryScreen<T extends SyncedGuiDescription> extends Handl
}
if (!description.isFullscreen()) {
- x = (width / 2) - (backgroundWidth / 2);
- y = (height / 2) - (backgroundHeight / 2);
+ x = (screenWidth / 2) - (backgroundWidth / 2);
+ y = (screenHeight / 2) - (backgroundHeight / 2);
titleX = 0;
titleY = 0;
} else {