This commit is contained in:
lukasabbe
2025-09-25 12:23:28 +02:00
parent 1147c36ccf
commit d6634ede54
4 changed files with 19 additions and 21 deletions
@@ -1,7 +1,6 @@
package com.lukasabbe.bookshelfinspector.renderer;
import com.lukasabbe.bookshelfinspector.BookshelfInspectorClient;
import com.lukasabbe.bookshelfinspector.Constants;
import com.lukasabbe.bookshelfinspector.data.BookData;
import com.lukasabbe.bookshelfinspector.util.RomanNumerals;
import com.mojang.blaze3d.vertex.PoseStack;
@@ -79,13 +78,13 @@ public class HudRenderer {
}
}
private static void drawScaledText(GuiGraphics context, Component text, int centerX, int y, int color, Font textRenderer){
Matrix3x2fStack stack = context.pose();
stack.pushMatrix();
stack.translate(centerX, y);
PoseStack stack = context.pose();
stack.pushPose();
stack.translate(centerX, y, 0);
final float scale = (float) BookshelfInspectorClient.config.scale / 10;
stack.scale(scale, scale);
stack.translate(-centerX, -y);
stack.scale(scale, scale, scale);
stack.translate(-centerX, -y, 0);
context.drawCenteredString(textRenderer,text,centerX,y,color);
stack.popMatrix();
stack.popPose();
}
}