Skip to content

Commit

Permalink
Should fix wrap in format
Browse files Browse the repository at this point in the history
  • Loading branch information
kappa-maintainer committed Apr 2, 2024
1 parent 53fdff4 commit 9ac1dc0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main/java/gkappa/wrapfix/mixin/MixinFontRenderer.java
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,9 @@ private void wrapStringToWidthICU4J(String str, int wrapWidth, CallbackInfoRetur
format.append('§').append(f); // Add to current format code
line.append('§').append(f);
widths[i - fed] = lineWidth;
widths[i - fed + 1] = lineWidth;
formats[i - fed] = format.toString();
formats[i - fed + 1] = format.toString();
i++;
continue;
}
Expand Down Expand Up @@ -115,7 +117,7 @@ private void wrapStringToWidthICU4J(String str, int wrapWidth, CallbackInfoRetur
lineWidth = getCharWidth(current);
} else {
d = icui - fed;
if (line.charAt(d + prevFormat - 1) == '§') WrapFix.logger.info("{} {} {}", line, d + prevFormat, list.toString());
if (line.charAt(d + prevFormat - 1) == '§') d--;
list.add(line.substring(0, d + prevFormat));
temp = line.substring(d + prevFormat);
fed = icui;
Expand Down

0 comments on commit 9ac1dc0

Please sign in to comment.