Fix drawString returing wrong value with 0 length string

This commit is contained in:
MrSlimeDude authored and Jason Mitchell committed 2024-01-04 19:25:06 -08:00
1 parent cf3cfd806f
commit 73c7ca94e1
1 file changed
+2 -2
@@ -319,7 +319,7 @@ public class BatchingFontRenderer {
final boolean unicodeFlag, final CharSequence string, int stringOffset, int stringLength) {
// noinspection SizeReplaceableByIsEmpty
if (string == null || string.length() == 0) {
return 0.0f;
return anchorX + (enableShadow ? 1.0f : 0.0f);
}
final int shadowColor = (color & 0xfcfcfc) >> 2 | color & 0xff000000;
@@ -571,7 +571,7 @@ public class BatchingFontRenderer {
} finally {
this.endBatch();
}
return curX;
return curX + (enableShadow ? 1.0f : 0.0f);
}
}