aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main/java/io/github/cottonmc/cotton/gui/client/BackgroundPainter.java4
-rw-r--r--src/main/java/io/github/cottonmc/cotton/gui/client/CottonInventoryScreen.java12
2 files changed, 10 insertions, 6 deletions
diff --git a/src/main/java/io/github/cottonmc/cotton/gui/client/BackgroundPainter.java b/src/main/java/io/github/cottonmc/cotton/gui/client/BackgroundPainter.java
index 3d84e7c..13ca534 100644
--- a/src/main/java/io/github/cottonmc/cotton/gui/client/BackgroundPainter.java
+++ b/src/main/java/io/github/cottonmc/cotton/gui/client/BackgroundPainter.java
@@ -58,8 +58,8 @@ public interface BackgroundPainter {
ScreenDrawing.drawBeveledPanel(matrices, (x * 18) + left - 4, (y * 18) + top - 4, 26, 26,
lo, bg, hi);
if (slot.getFocusedSlot() == index) {
- int sx = (x * 18) + left - 3;
- int sy = (y * 18) + top - 3;
+ int sx = (x * 18) + left - 4;
+ int sy = (y * 18) + top - 4;
ScreenDrawing.coloredRect(matrices, sx, sy, 26, 1, 0xFF_FFFFA0);
ScreenDrawing.coloredRect(matrices, sx, sy + 1, 1, 26 - 1, 0xFF_FFFFA0);
ScreenDrawing.coloredRect(matrices, sx + 26 - 1, sy + 1, 1, 26 - 1, 0xFF_FFFFA0);
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 c9ff831..0f7920b 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
@@ -111,8 +111,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;
@@ -120,8 +124,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 {