1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 21:37:35 +00:00

LibGfx: Make Font::width() return a float

This commit is contained in:
Andreas Kling 2023-01-03 14:43:07 +01:00
parent b9d2b8f7b2
commit 3407ab0fd1
25 changed files with 40 additions and 40 deletions

View file

@ -452,7 +452,7 @@ Gfx::IntRect TabWidget::close_button_rect(size_t index) const
int TabWidget::TabData::width(Gfx::Font const& font) const
{
auto width = 16 + font.width(title) + (icon ? (16 + 4) : 0);
auto width = 16 + static_cast<int>(ceilf(font.width(title))) + (icon ? (16 + 4) : 0);
// NOTE: This needs to always be an odd number, because the button rect
// includes 3px of light and shadow on the left and right edges. If
// the button rect width is not an odd number, the area left for the