1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 17:37:47 +00:00

LibTTF: ScaledFont should have a NonnullRefPtr<TTF::Font>

A ScaledFont without an underlying TTF::Font would not be valid.
This commit is contained in:
Andreas Kling 2021-02-17 23:35:25 +01:00
parent 13867600c3
commit 8aec1cd232
2 changed files with 5 additions and 7 deletions

View file

@ -65,10 +65,8 @@ RefPtr<Font> Typeface::get_font(unsigned size)
return font;
}
if (m_ttf_font) {
auto font = adopt(*new TTF::ScaledFont(m_ttf_font, size, size));
return font;
}
if (m_ttf_font)
return adopt(*new TTF::ScaledFont(*m_ttf_font, size, size));
return {};
}