Сalculate the height of the container before scrolling to the recipe (#782)

Co-authored-by: sisyphussy <221229741+sisyphussy@users.noreply.github.com>
This commit is contained in:
slprimeandsisyphussy authored and GitHub committed 2025-10-29 07:52:33 +00:00
1 parent af9726d356
commit bd6384bf24
1 file changed
+4 -4
@@ -322,6 +322,10 @@ public abstract class GuiRecipe<H extends IRecipeHandler> extends GuiContainer i
}
};
this.container.x = this.guiLeft + 3;
this.container.y = this.guiTop + 32;
this.container.h = this.ySize - 32 - 5;
GuiRecipe.toggleSearch.icon = new DrawableBuilder("nei:textures/nei_sprites.png", 0, 76, 10, 10).build();
GuiRecipe.toggleSearch.w = GuiRecipe.toggleSearch.h = 12;
GuiRecipe.toggleSearch.x = this.guiLeft + BORDER_PADDING + BUTTON_WIDTH;
@@ -698,11 +702,7 @@ public abstract class GuiRecipe<H extends IRecipeHandler> extends GuiContainer i
public void updateScreen() {
super.updateScreen();
this.container.x = this.guiLeft + 3;
this.container.y = this.guiTop + 32;
this.container.w = Math.max(this.xSize - 6, this.handlerInfo.getWidth());
this.container.h = this.ySize - 32 - 5;
this.handler.original.onUpdate();
refreshPage();