Skip to content

Commit

Permalink
(Hackily) Fix bug with REI overlapping with LibGui screens
Browse files Browse the repository at this point in the history
  • Loading branch information
Juuxel committed Dec 21, 2020
1 parent ea894bb commit 1a5d29e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ org.gradle.jvmargs=-Xmx1G
loader_version=0.10.8

# Mod Properties
mod_version = 3.3.1
mod_version = 3.3.2
maven_group = io.github.cottonmc
archives_base_name = LibGui

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,17 +97,21 @@ protected void reposition(int screenWidth, int screenHeight) {
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;
if (backgroundHeight<16) backgroundHeight=300;
}

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 {
Expand Down

0 comments on commit 1a5d29e

Please sign in to comment.