Skip to content

Commit f022a36

Browse files
authored
Merge branch 'EssentialGG:master' into master
2 parents 57c38b7 + 775e086 commit f022a36

3 files changed

Lines changed: 2 additions & 8 deletions

File tree

src/main/kotlin/gg/essential/elementa/components/UIWrappedText.kt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -147,12 +147,6 @@ open class UIWrappedText @JvmOverloads constructor(
147147
return super.draw(matrixStack)
148148
}
149149

150-
if (width / textScale <= charWidth) {
151-
// If we are smaller than a char, we can't physically split this string into
152-
// "width" strings, so we'll prefer a no-op to an error.
153-
return super.draw(matrixStack)
154-
}
155-
156150
if (!URenderPipeline.isRequired && !ElementaVersion.atLeastV9Active) {
157151
@Suppress("DEPRECATION")
158152
UGraphics.enableBlend()

src/main/kotlin/gg/essential/elementa/effects/ScissorEffect.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class ScissorEffect @JvmOverloads constructor(
4545

4646
override fun beforeDraw(matrixStack: UMatrixStack) {
4747
val bounds = customBoundingBox?.getScissorBounds() ?: scissorBounds ?: boundComponent.getScissorBounds()
48-
val scaleFactor = UResolution.scaleFactor.toInt()
48+
val scaleFactor = UResolution.scaleFactor
4949

5050
oldState = currentScissorState
5151
val state = oldState

src/main/kotlin/gg/essential/elementa/utils/text.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ fun getStringSplitToWidth(
129129
pushLine()
130130

131131
for (char in word.toCharArray()) {
132-
if ((currLine.toString() + char).width(textScale, fontProvider) > maxLineWidthSpace)
132+
if (currLine.isNotEmpty() && (currLine.toString() + char).width(textScale, fontProvider) > maxLineWidthSpace)
133133
pushLine()
134134
currLine.append(char)
135135
}

0 commit comments

Comments
 (0)