From ed08fe491130a722c8f0e909d7680740a3c7a5f4 Mon Sep 17 00:00:00 2001 From: shedaniel Date: Sun, 19 Jun 2022 03:34:11 +0800 Subject: Make scale indicator show on top --- .../rei/impl/client/gui/widget/entrylist/EntryListWidget.java | 3 +++ 1 file changed, 3 insertions(+) (limited to 'runtime/src/main/java') diff --git a/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/entrylist/EntryListWidget.java b/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/entrylist/EntryListWidget.java index 92fcb91ac..ab7bceaa4 100644 --- a/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/entrylist/EntryListWidget.java +++ b/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/entrylist/EntryListWidget.java @@ -232,12 +232,15 @@ public abstract class EntryListWidget extends WidgetWithBounds implements Overla scaleIndicator.update(delta); if (scaleIndicator.value() > 0.04) { + matrices.pushPose(); + matrices.translate(0, 0, 500); Component component = Component.literal(Math.round(ConfigObject.getInstance().getEntrySize() * 100) + "%"); int width = font.width(component); int backgroundColor = ((int) Math.round(0xa0 * Mth.clamp(scaleIndicator.value(), 0.0, 1.0))) << 24; int textColor = ((int) Math.round(0xdd * Mth.clamp(scaleIndicator.value(), 0.0, 1.0))) << 24; fillGradient(matrices, bounds.getCenterX() - width / 2 - 2, bounds.getCenterY() - 6, bounds.getCenterX() + width / 2 + 2, bounds.getCenterY() + 6, backgroundColor, backgroundColor); font.draw(matrices, component, bounds.getCenterX() - width / 2, bounds.getCenterY() - 4, 0xFFFFFF | textColor); + matrices.popPose(); } } -- cgit