From 2341dafe1bae8579d8e5729d474a15807eda88c8 Mon Sep 17 00:00:00 2001 From: Username404-59 Date: Sun, 22 Feb 2026 01:44:14 +0100 Subject: [PATCH] Fix FontUtil.drawScaled Signed-off-by: Username404-59 --- .../main/kotlin/fr/username404/snowygui/utils/FontUtil.kt | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/common/src/main/kotlin/fr/username404/snowygui/utils/FontUtil.kt b/common/src/main/kotlin/fr/username404/snowygui/utils/FontUtil.kt index 678767b..349c897 100644 --- a/common/src/main/kotlin/fr/username404/snowygui/utils/FontUtil.kt +++ b/common/src/main/kotlin/fr/username404/snowygui/utils/FontUtil.kt @@ -4,18 +4,17 @@ import net.minecraft.client.Minecraft import fr.username404.snowygui.gui.feature.Colors import net.minecraft.client.gui.GuiGraphics import net.minecraft.util.ARGB -import org.joml.Matrix3x2f object FontUtil { fun drawScaled(guiGraphics: GuiGraphics, text: String, x: Double, y: Double, scaleFactor: Float, color: Colors = Colors.BLACK) { val stack = guiGraphics.pose() - stack.scale(scaleFactor, scaleFactor, Matrix3x2f()) + stack.scale(scaleFactor, scaleFactor) guiGraphics.drawString( Minecraft.getInstance().font, text, - x.toInt(), y.toInt(), + (x / scaleFactor).toInt(), (y / scaleFactor).toInt(), ARGB.opaque(color.hexValue), false ) val factorToOriginal = 1F / scaleFactor - stack.scale(factorToOriginal, factorToOriginal, Matrix3x2f()) + stack.scale(factorToOriginal, factorToOriginal) } }