1
0
Fork 0
mirror of https://github.com/Ellpeck/MLEM.git synced 2024-11-22 20:58:34 +01:00

consistently use the default font's line height

This commit is contained in:
Ell 2021-11-28 11:30:57 +01:00
parent a11a63c067
commit 252d06888f
2 changed files with 5 additions and 5 deletions

View file

@ -142,10 +142,10 @@ namespace MLEM.Font {
switch (text[i]) { switch (text[i]) {
case '\n': case '\n':
xOffset = 0; xOffset = 0;
size.Y += font.LineHeight; size.Y += this.LineHeight;
break; break;
case OneEmSpace: case OneEmSpace:
xOffset += font.LineHeight; xOffset += this.LineHeight;
break; break;
case Nbsp: case Nbsp:
xOffset += font.MeasureChar(' '); xOffset += font.MeasureChar(' ');
@ -170,7 +170,7 @@ namespace MLEM.Font {
size.X = xOffset; size.X = xOffset;
} }
// include the last line's height too! // include the last line's height too!
size.Y += (fontFunction?.Invoke(text.Length - 1) ?? this).LineHeight; size.Y += this.LineHeight;
return size; return size;
} }

View file

@ -194,7 +194,7 @@ namespace MLEM.Formatting {
if (l < token.SplitDisplayString.Length - 1) { if (l < token.SplitDisplayString.Length - 1) {
innerOffset.X = token.InnerOffsets[l] = this.GetInnerOffsetX(font, t, l + 1, alignment); innerOffset.X = token.InnerOffsets[l] = this.GetInnerOffsetX(font, t, l + 1, alignment);
innerOffset.Y += tokenFont.LineHeight; innerOffset.Y += font.LineHeight;
} else { } else {
innerOffset.X += size.X; innerOffset.X += size.X;
} }
@ -239,7 +239,7 @@ namespace MLEM.Formatting {
if (index <= 0) if (index <= 0)
return token.GetFont(font); return token.GetFont(font);
} }
return font; return null;
} }
} }