diff options
| author | shedaniel <daniel@shedaniel.me> | 2021-10-16 03:14:14 +0800 |
|---|---|---|
| committer | shedaniel <daniel@shedaniel.me> | 2021-10-16 03:14:48 +0800 |
| commit | b42449c3aa28982286e0f4c6800c575fef1025f5 (patch) | |
| tree | 83475d7b2eede2bc3a50ff0418a2bf3767144641 /runtime/src | |
| parent | 2b5c4148b5964309d80f731d67d14675981c0e18 (diff) | |
| download | RoughlyEnoughItems-b42449c3aa28982286e0f4c6800c575fef1025f5.tar.gz RoughlyEnoughItems-b42449c3aa28982286e0f4c6800c575fef1025f5.tar.bz2 RoughlyEnoughItems-b42449c3aa28982286e0f4c6800c575fef1025f5.zip | |
Fix top bar
Diffstat (limited to 'runtime/src')
| -rw-r--r-- | runtime/src/main/java/me/shedaniel/rei/impl/client/gui/screen/DefaultDisplayViewingScreen.java | 4 |
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)); |
