File tree Expand file tree Collapse file tree 3 files changed +5
-3
lines changed
shale/src/main/kotlin/moe/nea/shale/render/minecraft Expand file tree Collapse file tree 3 files changed +5
-3
lines changed Original file line number Diff line number Diff line change 11package moe.nea.shale.render.minecraft
22
33import io.github.notenoughupdates.moulconfig.common.RenderContext
4+ import io.github.notenoughupdates.moulconfig.common.text.StructuredText
45import moe.nea.shale.layout.Area
56import moe.nea.shale.layout.MeasuredText
67import moe.nea.shale.layout.Position
@@ -27,7 +28,7 @@ class MinecraftGraphicsContext(
2728 val font = renderContext.minecraft.defaultFontRenderer
2829
2930 override fun measureWrappedText (text : String , width : Int ): MeasuredText {
30- val lines = font.splitText(text, width)
31+ val lines = font.splitText(StructuredText .of( text) , width)
3132 val size = Size (
3233 lines.maxOfOrNull { font.getStringWidth(it) } ? : 0 ,
3334 font.height * lines.size
Original file line number Diff line number Diff line change 11package moe.nea.shale.render.minecraft
22
3+ import io.github.notenoughupdates.moulconfig.common.text.StructuredText
34import moe.nea.shale.layout.MeasuredText
45import moe.nea.shale.layout.Size
56
67data class MinecraftWrappedText (
7- val lines : List <String >,
8+ val lines : List <StructuredText >,
89 override val size : Size
910) : MeasuredText
Original file line number Diff line number Diff line change @@ -24,6 +24,6 @@ class ShaleComponent(val tree: RootElement) : GuiComponent() {
2424 }
2525
2626 fun openScreen () {
27- IMinecraft .instance .openWrappedScreen(this )
27+ IMinecraft .INSTANCE .openWrappedScreen(this )
2828 }
2929}
You can’t perform that action at this time.
0 commit comments