fix(renderer): adjust line height calculation in G2DDrawFont for improved text rendering

This commit is contained in:
extio-de
2026-01-01 18:39:44 +01:00
parent 7dbe26a5cd
commit fa45c5d5e3

View File

@@ -91,7 +91,7 @@ public class G2DDrawFont extends G2DAbstractRenderingBo implements DrawFontRende
graphics.setColor(this.color == null ? this.rendererData.getThemeManager().getCurrentTheme().getTextNormal().toColor() : this.color.toAwtColor()); graphics.setColor(this.color == null ? this.rendererData.getThemeManager().getCurrentTheme().getTextNormal().toColor() : this.color.toAwtColor());
final var lines = this.text.contains("\n") ? this.text.split("\n", -1) : new String[] { this.text }; final var lines = this.text.contains("\n") ? this.text.split("\n", -1) : new String[] { this.text };
final var lineHeight = getTextDimensions("M", graphics, this.size, 1.0).getY(); final var lineHeight = getTextDimensions("M", graphics, this.size, 1.0).getY() + (int) (Math.max(FONT_SIZE_MIN, this.size) * 0.4 * scaleFactor);
final CoordI2[] lineDims = new CoordI2[lines.length]; final CoordI2[] lineDims = new CoordI2[lines.length];
int maxLineWidth = 0; int maxLineWidth = 0;
for (int i = 0; i < lines.length; i++) { for (int i = 0; i < lines.length; i++) {