summaryrefslogtreecommitdiff
path: root/Userland/Applications/Welcome/WelcomeWidget.cpp
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2023-01-03 14:43:07 +0100
committerAndreas Kling <kling@serenityos.org>2023-01-03 15:25:02 +0100
commit3407ab0fd1c287391cad8cb89e4a36fa3a07c453 (patch)
tree77c03fa1636b89088423831aadc4fe0005e898a3 /Userland/Applications/Welcome/WelcomeWidget.cpp
parentb9d2b8f7b2ef05d62949b8f1c17016428f7c661c (diff)
downloadserenity-3407ab0fd1c287391cad8cb89e4a36fa3a07c453.zip
LibGfx: Make Font::width() return a float
Diffstat (limited to 'Userland/Applications/Welcome/WelcomeWidget.cpp')
-rw-r--r--Userland/Applications/Welcome/WelcomeWidget.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/Userland/Applications/Welcome/WelcomeWidget.cpp b/Userland/Applications/Welcome/WelcomeWidget.cpp
index d5c82cc558..0078ab8c9b 100644
--- a/Userland/Applications/Welcome/WelcomeWidget.cpp
+++ b/Userland/Applications/Welcome/WelcomeWidget.cpp
@@ -110,6 +110,6 @@ void WelcomeWidget::paint_event(GUI::PaintEvent& event)
static auto font = Gfx::BitmapFont::load_from_file("/res/fonts/MarietaRegular24.font"sv);
painter.draw_text({ 12, 4, 1, 30 }, "Welcome to "sv, *font, Gfx::TextAlignment::CenterLeft, palette().base_text());
- painter.draw_text({ 12 + font->width("Welcome to "sv), 4, 1, 30 }, "Serenity"sv, font->bold_variant(), Gfx::TextAlignment::CenterLeft, palette().base_text());
- painter.draw_text({ 12 + font->width("Welcome to "sv) + font->bold_variant().width("Serenity"sv), 4, 1, 30 }, "OS"sv, font->bold_variant(), Gfx::TextAlignment::CenterLeft, palette().base() == palette().window() ? palette().base_text() : palette().base());
+ painter.draw_text({ 12 + static_cast<int>(ceilf(font->width("Welcome to "sv))), 4, 1, 30 }, "Serenity"sv, font->bold_variant(), Gfx::TextAlignment::CenterLeft, palette().base_text());
+ painter.draw_text({ 12 + static_cast<int>(ceilf(font->width("Welcome to "sv))) + static_cast<int>(ceilf(font->bold_variant().width("Serenity"sv))), 4, 1, 30 }, "OS"sv, font->bold_variant(), Gfx::TextAlignment::CenterLeft, palette().base() == palette().window() ? palette().base_text() : palette().base());
}