mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 15:57:36 +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:
parent
13867600c3
commit
8aec1cd232
2 changed files with 5 additions and 7 deletions
|
@ -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 {};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue