mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 09:17:35 +00:00
LibGfx+Userland: Add width_rounded_up() helper
This commit is contained in:
parent
c9404c3a63
commit
55423b4ed0
21 changed files with 34 additions and 19 deletions
|
@ -36,6 +36,11 @@ ScaledFont::ScaledFont(NonnullRefPtr<VectorFont> font, float point_width, float
|
|||
};
|
||||
}
|
||||
|
||||
int ScaledFont::width_rounded_up(StringView view) const
|
||||
{
|
||||
return static_cast<int>(ceilf(width(view)));
|
||||
}
|
||||
|
||||
float ScaledFont::width(StringView view) const { return unicode_view_width(Utf8View(view)); }
|
||||
float ScaledFont::width(Utf8View const& view) const { return unicode_view_width(view); }
|
||||
float ScaledFont::width(Utf32View const& view) const { return unicode_view_width(view); }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue