From ba4f54dc55370eded362b23213ea7a97b925db94 Mon Sep 17 00:00:00 2001 From: Raycoms Date: Fri, 15 Nov 2024 14:20:15 +0100 Subject: [PATCH] fix banner picker --- .../minecolonies/core/client/gui/WindowBannerPicker.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/minecolonies/core/client/gui/WindowBannerPicker.java b/src/main/java/com/minecolonies/core/client/gui/WindowBannerPicker.java index 35c6f1f346d..646afe5abeb 100644 --- a/src/main/java/com/minecolonies/core/client/gui/WindowBannerPicker.java +++ b/src/main/java/com/minecolonies/core/client/gui/WindowBannerPicker.java @@ -505,10 +505,10 @@ public PatternButton(int x, int y, int height, Holder pattern) @Override public void renderWidget(final GuiGraphics stack, int mx, int my, float p_renderButton_3_) { - this.visible = scrollRow * PATTERN_COLUMNS <= this.index && this.index < PATTERN_COLUMNS * (scrollRow + PATTERN_ROWS); + boolean isVisible = scrollRow * PATTERN_COLUMNS <= this.index && this.index < PATTERN_COLUMNS * (scrollRow + PATTERN_ROWS); this.active = activeLayer != 0; - if (!this.active || !this.visible) return; + if (!this.active || !this.visible || !isVisible) return; int position = Math.floorDiv(this.index - scrollRow*PATTERN_COLUMNS, PATTERN_COLUMNS); this.setY(center(WindowBannerPicker.this.height, PATTERN_ROWS, PATTERN_HEIGHT, position, PATTERN_MARGIN)); @@ -516,7 +516,7 @@ public void renderWidget(final GuiGraphics stack, int mx, int my, float p_render super.renderWidget(stack, mx, my, p_renderButton_3_); - if (this.visible) + if (isVisible) { if (this.isHovered && this.active) stack.fill(this.getX(), this.getY(), this.getX()+this.width, this.getY()+this.height, 0xDDFFFFFF);