рендерим текст во всю ширину блока

font.width выдаёт ширину на 1 пиксель больше, так что чем больше текст тем больше смещение от этого самого пикселя
This commit is contained in:
YuRaNnNzZZ 2024-10-24 06:26:30 +03:00
parent 29ab315e43
commit bb7d3425f4
Signed by: YuRaNnNzZZ
GPG Key ID: 5F71738C85A6006D

View File

@ -38,7 +38,7 @@ class HoloSignRenderer(private val context: BlockEntityRendererProvider.Context)
if (tile.textAutoScale) {
val totalWidth = lines.maxOf { font.width(it) }.toFloat()
val highest = totalWidth.coerceAtLeast(totalHeight)
val mul = if (highest > 64f) 1f / (highest / 64f) else 64f / highest
val mul = if (highest > 96f) 1f / (highest / 96f) else 96f / highest
poseStack.scale(mul, mul, mul)
}