diff options
| author | shedaniel <daniel@shedaniel.me> | 2021-10-16 03:14:14 +0800 |
|---|---|---|
| committer | shedaniel <daniel@shedaniel.me> | 2021-10-16 03:14:14 +0800 |
| commit | 4f78d37a3df6c4ce0c1dc70c5aab9884d6da498c (patch) | |
| tree | 7ab5354fb2a5b514aeb818dcc903ec976c9c6d43 /runtime/src/main/java | |
| parent | 6467996325d6435a99cf5e098e9f91c054e507a6 (diff) | |
| download | RoughlyEnoughItems-4f78d37a3df6c4ce0c1dc70c5aab9884d6da498c.tar.gz RoughlyEnoughItems-4f78d37a3df6c4ce0c1dc70c5aab9884d6da498c.tar.bz2 RoughlyEnoughItems-4f78d37a3df6c4ce0c1dc70c5aab9884d6da498c.zip | |
Fix top bar
Diffstat (limited to 'runtime/src/main/java')
| -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 9a24d66a6..7c71052e1 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)); |
