From b42449c3aa28982286e0f4c6800c575fef1025f5 Mon Sep 17 00:00:00 2001 From: shedaniel Date: Sat, 16 Oct 2021 03:14:14 +0800 Subject: Fix top bar --- .../rei/impl/client/gui/screen/DefaultDisplayViewingScreen.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'runtime/src') 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., 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., 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)); -- cgit