This commit is contained in:
2024-03-27 22:38:48 +02:00
parent a5aed4266d
commit 88fd764928
14 changed files with 813 additions and 341 deletions

View File

@@ -91,7 +91,7 @@ namespace Game
private int GetFontCharacterWidth()
{
Font font = Font.GetFont();
Font font = Font?.GetFont();
if (!font)
return 0;
return (int)font.MeasureText("a").X; // hacky, but works for fixed-size fonts...
@@ -99,7 +99,7 @@ namespace Game
public int GetFontHeight()
{
Font font = Font.GetFont();
Font font = Font?.GetFont();
if (font == null)
return (int)Height;
@@ -108,7 +108,7 @@ namespace Game
private int GetHeightInLines()
{
Font font = Font.GetFont();
Font font = Font?.GetFont();
if (!font)
return 0;
return (int)(Height / (font.Height / Platform.DpiScale)); // number of fully visible lines
@@ -323,7 +323,6 @@ namespace Game
}
}
Render2D.FillRectangle(selectionRect, selectionColor);
layout.Bounds.Y += lineHeight;