diff --git a/src/main/kotlin/gg/essential/elementa/components/UIWrappedText.kt b/src/main/kotlin/gg/essential/elementa/components/UIWrappedText.kt index 3e88e4ab..8aa5824e 100644 --- a/src/main/kotlin/gg/essential/elementa/components/UIWrappedText.kt +++ b/src/main/kotlin/gg/essential/elementa/components/UIWrappedText.kt @@ -145,12 +145,6 @@ open class UIWrappedText @JvmOverloads constructor( return super.draw(matrixStack) } - if (width / textScale <= charWidth) { - // If we are smaller than a char, we can't physically split this string into - // "width" strings, so we'll prefer a no-op to an error. - return super.draw(matrixStack) - } - UGraphics.enableBlend() val lines = if (trimText) { diff --git a/src/main/kotlin/gg/essential/elementa/utils/text.kt b/src/main/kotlin/gg/essential/elementa/utils/text.kt index c0f68502..56a95b8e 100644 --- a/src/main/kotlin/gg/essential/elementa/utils/text.kt +++ b/src/main/kotlin/gg/essential/elementa/utils/text.kt @@ -129,7 +129,7 @@ fun getStringSplitToWidth( pushLine() for (char in word.toCharArray()) { - if ((currLine.toString() + char).width(textScale, fontProvider) > maxLineWidthSpace) + if (currLine.isNotEmpty() && (currLine.toString() + char).width(textScale, fontProvider) > maxLineWidthSpace) pushLine() currLine.append(char) }