1
0
Fork 0
mirror of https://github.com/Ellpeck/MLEM.git synced 2024-12-25 01:39:23 +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]) {
case '\n':
xOffset = 0;
size.Y += font.LineHeight;
size.Y += this.LineHeight;
break;
case OneEmSpace:
xOffset += font.LineHeight;
xOffset += this.LineHeight;
break;
case Nbsp:
xOffset += font.MeasureChar(' ');
@ -170,7 +170,7 @@ namespace MLEM.Font {
size.X = xOffset;
}
// include the last line's height too!
size.Y += (fontFunction?.Invoke(text.Length - 1) ?? this).LineHeight;
size.Y += this.LineHeight;
return size;
}

View file

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