From 4e1cd4c38b6a84467e19c30472f662147edbb8a3 Mon Sep 17 00:00:00 2001 From: arcade_kappa Date: Wed, 3 Apr 2024 18:15:15 +0800 Subject: [PATCH] Fix fed tracker --- src/main/java/gkappa/wrapfix/mixin/MixinFontRenderer.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/gkappa/wrapfix/mixin/MixinFontRenderer.java b/src/main/java/gkappa/wrapfix/mixin/MixinFontRenderer.java index 90786f0..d3afb7a 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 += line.length() - 1; line.delete(0, line.length()).append(format).append(current); prevFormat = format.length(); lineWidth = getCharWidth(current);