diff options
author | Andreas Kling <kling@serenityos.org> | 2023-01-03 14:43:07 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2023-01-03 15:25:02 +0100 |
commit | 3407ab0fd1c287391cad8cb89e4a36fa3a07c453 (patch) | |
tree | 77c03fa1636b89088423831aadc4fe0005e898a3 /Userland/Libraries/LibWeb/HTML | |
parent | b9d2b8f7b2ef05d62949b8f1c17016428f7c661c (diff) | |
download | serenity-3407ab0fd1c287391cad8cb89e4a36fa3a07c453.zip |
LibGfx: Make Font::width() return a float
Diffstat (limited to 'Userland/Libraries/LibWeb/HTML')
-rw-r--r-- | Userland/Libraries/LibWeb/HTML/CanvasRenderingContext2D.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Libraries/LibWeb/HTML/CanvasRenderingContext2D.cpp b/Userland/Libraries/LibWeb/HTML/CanvasRenderingContext2D.cpp index ef0a4a727b..82bdcde6f5 100644 --- a/Userland/Libraries/LibWeb/HTML/CanvasRenderingContext2D.cpp +++ b/Userland/Libraries/LibWeb/HTML/CanvasRenderingContext2D.cpp @@ -205,7 +205,7 @@ void CanvasRenderingContext2D::fill_text(DeprecatedString const& text, float x, auto& drawing_state = this->drawing_state(); // FIXME: painter only supports integer rects for text right now, so this effectively chops off any fractional position - auto text_rect = Gfx::IntRect(x, y, max_width.has_value() ? max_width.value() : painter->font().width(text), painter->font().pixel_size()); + auto text_rect = Gfx::IntRect(x, y, max_width.has_value() ? static_cast<float>(max_width.value()) : painter->font().width(text), painter->font().pixel_size()); auto transformed_rect = drawing_state.transform.map(text_rect); painter->draw_text(transformed_rect, text, Gfx::TextAlignment::TopLeft, drawing_state.fill_style); did_draw(transformed_rect.to_type<float>()); |