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);