From 09519f6b8366ceee8bfe479475c23cc54d39f2ab Mon Sep 17 00:00:00 2001 From: arcade_kappa Date: Wed, 3 Apr 2024 19:44:33 +0800 Subject: [PATCH] Fix array oob --- src/main/java/gkappa/wrapfix/mixin/MixinFontRenderer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/gkappa/wrapfix/mixin/MixinFontRenderer.java b/src/main/java/gkappa/wrapfix/mixin/MixinFontRenderer.java index d11535e..5c50a3d 100644 --- a/src/main/java/gkappa/wrapfix/mixin/MixinFontRenderer.java +++ b/src/main/java/gkappa/wrapfix/mixin/MixinFontRenderer.java @@ -117,7 +117,7 @@ private void wrapStringToWidthICU4J(String str, int wrapWidth, CallbackInfoRetur lineWidth = getCharWidth(current); } else { d = icui - fed; - if (line.charAt(d + prevFormat - 1) == '§') d--; + if (line.charAt(d + prevFormat - 1) == '§') d++; list.add(line.substring(0, d + prevFormat)); temp = line.substring(d + prevFormat); fed += d;