mirror of
https://github.com/GTNewHorizons/NotEnoughItems.git
synced 2026-11-20 04:09:45 +00:00
fix recipe height
This commit is contained in:
1 parent
900d8ed828
commit
8a6bbb24fc
6 files changed
+71
-22
No files matched your search
@@ -96,8 +96,6 @@ public abstract class GuiRecipe<H extends IRecipeHandler> extends GuiContainer i
|
||||
private SearchRecipeHandler<H> handler;
|
||||
private HandlerInfo handlerInfo;
|
||||
|
||||
private int yShift = 0;
|
||||
|
||||
protected static final RestartableTask updateFilter = new RestartableTask("NEI Recipe Filtering") {
|
||||
|
||||
@Override
|
||||
@@ -353,6 +351,8 @@ public abstract class GuiRecipe<H extends IRecipeHandler> extends GuiContainer i
|
||||
if (!cacheKey.equals(this.recipePageCacheKey)) {
|
||||
this.recipePageCacheKey = cacheKey;
|
||||
|
||||
final boolean recipeGrow = this.handlerInfo.useCustomScroll()
|
||||
&& this.handlerInfo.getMaxRecipesPerPage() <= 1;
|
||||
final List<Widget> widgets = new ArrayList<>();
|
||||
int shiftY = 0;
|
||||
|
||||
@@ -361,6 +361,12 @@ public abstract class GuiRecipe<H extends IRecipeHandler> extends GuiContainer i
|
||||
.getRecipeWidget();
|
||||
widget.setLocation(Math.max(0, (this.container.w - widget.w) / 2), shiftY);
|
||||
|
||||
if (recipeGrow) {
|
||||
widget.h = Math.min(
|
||||
this.handlerInfo.getHeight() + this.handlerInfo.getYShift(),
|
||||
this.container.getVisibleHeight());
|
||||
}
|
||||
|
||||
widgets.add(widget);
|
||||
shiftY += widget.h;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user