mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-09 01:29:17 +00:00
LibGfx: Make Font::width() return a float
This commit is contained in:
parent
b9d2b8f7b2
commit
3407ab0fd1
Notes:
sideshowbarker
2024-07-17 02:15:20 +09:00
Author: https://github.com/awesomekling
Commit: 3407ab0fd1
25 changed files with 40 additions and 40 deletions
|
@ -43,7 +43,7 @@ void GroupBox::paint_event(PaintEvent& event)
|
|||
Gfx::StylePainter::paint_frame(painter, frame_rect, palette(), Gfx::FrameShape::Box, Gfx::FrameShadow::Sunken, 2);
|
||||
|
||||
if (!m_title.is_empty()) {
|
||||
Gfx::IntRect text_rect { 6, 1, font().width(m_title) + 6, font().glyph_height() };
|
||||
Gfx::IntRect text_rect { 6, 1, static_cast<int>(ceilf(font().width(m_title) + 6)), font().glyph_height() };
|
||||
painter.fill_rect(text_rect, palette().button());
|
||||
painter.draw_text(text_rect, m_title, Gfx::TextAlignment::Center, palette().button_text());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue