diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/client/render/blockentity/HoloSignRenderer.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/client/render/blockentity/HoloSignRenderer.kt index 6242b1eee..ed719fb84 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/client/render/blockentity/HoloSignRenderer.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/client/render/blockentity/HoloSignRenderer.kt @@ -35,6 +35,11 @@ class HoloSignRenderer(private val context: BlockEntityRendererProvider.Context) val totalHeight = lines.size * font.lineHeight + (lines.size - 1) * 2f var y = -totalHeight / 2f + val totalWidth = lines.maxOf { font.width(it) }.toFloat() + val highest = totalWidth.coerceAtLeast(totalHeight) + val mul = if (highest > 64f) 1f / (highest / 64f) else 64f / highest + poseStack.scale(mul, mul, mul) + for (line in lines) { font.draw(poseStack = poseStack, buffer = bufferSource, text = line, gravity = RenderGravity.TOP_CENTER, y = y, color = RGBAColor(tile.textRed, tile.textGreen, tile.textBlue, tile.textAlpha)) y += font.lineHeight + 2f