From 612a3f64f1d90caaa215e25a7e968662724fc2d1 Mon Sep 17 00:00:00 2001 From: arcade_kappa Date: Wed, 3 Apr 2024 18:34:43 +0800 Subject: [PATCH] Fix wxtreme case --- src/main/java/gkappa/wrapfix/mixin/MixinFontRenderer.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/gkappa/wrapfix/mixin/MixinFontRenderer.java b/src/main/java/gkappa/wrapfix/mixin/MixinFontRenderer.java index 90786f0..d11535e 100644 --- a/src/main/java/gkappa/wrapfix/mixin/MixinFontRenderer.java +++ b/src/main/java/gkappa/wrapfix/mixin/MixinFontRenderer.java @@ -62,7 +62,7 @@ private void wrapStringToWidthICU4J(String str, int wrapWidth, CallbackInfoRetur switch (current) { case '\n': list.add(line.toString()); - fed = i; + fed++; line.delete(0, line.length()).append(format); lineWidth = 0; widths[i - fed] = lineWidth; @@ -111,7 +111,7 @@ private void wrapStringToWidthICU4J(String str, int wrapWidth, CallbackInfoRetur } if (icui <= fed || i == icui) { list.add(line.substring(0,line.length() - 1)); - fed = i - 1; + fed = i; line.delete(0, line.length()).append(format).append(current); prevFormat = format.length(); lineWidth = getCharWidth(current); @@ -120,7 +120,7 @@ private void wrapStringToWidthICU4J(String str, int wrapWidth, CallbackInfoRetur if (line.charAt(d + prevFormat - 1) == 'ยง') d--; list.add(line.substring(0, d + prevFormat)); temp = line.substring(d + prevFormat); - fed = icui; + fed += d; line.delete(0, line.length()).append(formats[d]).append(temp); prevFormat = formats[d].length(); lineWidth = lineWidth - widths[d - 1];