mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 04:07:44 +00:00
Userland: Use Font::pixel_size_rounded_up() instead of glyph_height()
The only remaining clients of this API are specific to bitmap fonts and editing thereof.
This commit is contained in:
parent
93c9344e35
commit
b71c7a6e44
32 changed files with 63 additions and 65 deletions
|
@ -30,8 +30,8 @@ public:
|
|||
m_label->set_text(Gfx::parse_ampersand_string(tooltip));
|
||||
int tooltip_width = m_label->effective_min_size().width().as_int() + 10;
|
||||
int line_count = m_label->text().count("\n"sv);
|
||||
int glyph_height = m_label->font().glyph_height();
|
||||
int tooltip_height = glyph_height * (1 + line_count) + ((glyph_height + 1) / 2) * line_count + 8;
|
||||
int font_size = m_label->font().pixel_size_rounded_up();
|
||||
int tooltip_height = font_size * (1 + line_count) + ((font_size + 1) / 2) * line_count + 8;
|
||||
|
||||
Gfx::IntRect desktop_rect = Desktop::the().rect();
|
||||
if (tooltip_width > desktop_rect.width())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue