Right-align F3 panel text on the right column

This commit is contained in:
DreamYao520 committed 2026-10-04 05:50:41 +08:00
1 parent 70adb9480e
commit dd7b0932af
1 file changed
+4 -2
@@ -139,7 +139,8 @@ public class MixinGuiIngameForge_ModernF3 {
final int x = right ? width - panelWidth - 4 : 4;
angelica$drawDebugPanel(x, y, panelWidth, panelHeight, 0x90505050, true);
angelica$drawDebugPanel(x, y, panelWidth, lineHeight + 6, 0xA0606060, false);
fontrenderer.drawString(title, x + 3, y + (lineHeight + 6 - fontrenderer.FONT_HEIGHT) / 2 + 1, 0xFFFFFF);
final int titleX = right ? x + panelWidth - 3 - fontrenderer.getStringWidth(title) : x + 3;
fontrenderer.drawString(title, titleX, y + (lineHeight + 6 - fontrenderer.FONT_HEIGHT) / 2 + 1, 0xFFFFFF);
final boolean scaleText = target && lines.size() > 3;
if (scaleText) GLStateManager.glPushMatrix();
try {
@@ -150,7 +151,8 @@ public class MixinGuiIngameForge_ModernF3 {
}
int textY = scaleText ? 0 : y + lineHeight + 10;
for (String line : lines) {
fontrenderer.drawString(line, scaleText ? 0 : x + 3, textY, 0xE0E0E0);
final int textX = right ? x + panelWidth - 3 - fontrenderer.getStringWidth(line) : (scaleText ? 0 : x + 3);
fontrenderer.drawString(line, textX, textY, 0xE0E0E0);
textY += lineHeight;
}
} finally {