LibGfx: Use Font::pixel_size() instead of glyph_height() when painting

This gives us correct height metrics for both bitmap and scalable fonts.
This commit is contained in:
Andreas Kling 2022-03-27 00:55:08 +01:00
commit 65629d26fe
Notes: sideshowbarker 2024-07-17 16:42:08 +09:00
2 changed files with 7 additions and 7 deletions

View file

@ -28,7 +28,7 @@ IntRect TextLayout::bounding_rect(TextWrapping wrapping, int line_spacing) const
}
IntRect bounding_rect = {
0, 0, 0, static_cast<int>((lines.size() * (m_font->glyph_height() + line_spacing)) - line_spacing)
0, 0, 0, static_cast<int>((lines.size() * (m_font->pixel_size() + line_spacing)) - line_spacing)
};
for (auto& line : lines) {