mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 07:07:34 +00:00
LibGfx: Make Font::width() return a float
This commit is contained in:
parent
b9d2b8f7b2
commit
3407ab0fd1
25 changed files with 40 additions and 40 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue