Fix FontUtil.kt
This commit is contained in:
parent
81f4923185
commit
ce9f1c83dd
|
@ -7,7 +7,7 @@ import fr.username404.snowygui.gui.feature.Colors
|
||||||
object FontUtil {
|
object FontUtil {
|
||||||
fun drawScaled(stack: PoseStack, text: String, x: Double, y: Double, scaleFactor: Float, color: Colors = Colors.BLACK) {
|
fun drawScaled(stack: PoseStack, text: String, x: Double, y: Double, scaleFactor: Float, color: Colors = Colors.BLACK) {
|
||||||
stack.scale(scaleFactor, scaleFactor, scaleFactor)
|
stack.scale(scaleFactor, scaleFactor, scaleFactor)
|
||||||
Minecraft.getInstance().font.draw(stack, text, (x / scaleFactor).toFloat(), (y / scaleFactor).toFloat(), color)
|
Minecraft.getInstance().font.draw(stack, text, (x / scaleFactor).toFloat(), (y / scaleFactor).toFloat(), color.hexValue)
|
||||||
val factorToOriginal = 1F / scaleFactor
|
val factorToOriginal = 1F / scaleFactor
|
||||||
stack.scale(factorToOriginal, factorToOriginal, factorToOriginal)
|
stack.scale(factorToOriginal, factorToOriginal, factorToOriginal)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue