aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorshedaniel <daniel@shedaniel.me>2021-10-16 03:14:14 +0800
committershedaniel <daniel@shedaniel.me>2021-10-16 03:14:48 +0800
commitb42449c3aa28982286e0f4c6800c575fef1025f5 (patch)
tree83475d7b2eede2bc3a50ff0418a2bf3767144641
parent2b5c4148b5964309d80f731d67d14675981c0e18 (diff)
downloadRoughlyEnoughItems-b42449c3aa28982286e0f4c6800c575fef1025f5.tar.gz
RoughlyEnoughItems-b42449c3aa28982286e0f4c6800c575fef1025f5.tar.bz2
RoughlyEnoughItems-b42449c3aa28982286e0f4c6800c575fef1025f5.zip
Fix top bar
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/gui/screen/DefaultDisplayViewingScreen.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/screen/DefaultDisplayViewingScreen.java b/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/screen/DefaultDisplayViewingScreen.java
index cca34512f..dc5ef4c4c 100644
--- a/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/screen/DefaultDisplayViewingScreen.java
+++ b/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/screen/DefaultDisplayViewingScreen.java
@@ -156,8 +156,8 @@ public class DefaultDisplayViewingScreen extends AbstractDisplayViewingScreen {
this.widgets.clear();
int largestHeight = Math.max(height - 34 - 30, 100);
int maxWidthDisplay = CollectionUtils.mapAndMax(getCurrentDisplayed(), getCurrentCategory()::getDisplayWidth, Comparator.naturalOrder()).orElse(150);
- int maxHeight = CollectionUtils.<DisplayCategory<?>, Integer>mapAndMax(categories,
- category -> (category.getDisplayHeight() + 4) * Math.max(1, getRecipesPerPage(largestHeight, category) + 1) + 36, Comparator.naturalOrder()).orElse(66);
+ int maxHeight = Math.min(largestHeight, CollectionUtils.<DisplayCategory<?>, Integer>mapAndMax(categories,
+ category -> (category.getDisplayHeight() + 4) * Math.max(1, getRecipesPerPage(largestHeight, category) + 1) + 36, Comparator.naturalOrder()).orElse(66));
int totalDisplayHeight = (getCurrentCategory().getDisplayHeight() + 4) * Math.max(1, getRecipesPerPage(maxHeight, getCurrentCategory()) + 1) + 36;
int guiWidth = Math.max(maxWidthDisplay + 10, 190);
this.bounds = new Rectangle(width / 2 - guiWidth / 2, height / 2 - maxHeight / 2, guiWidth, Math.min(maxHeight, totalDisplayHeight));