1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 04:47:34 +00:00

LibGfx: Slim down Gfx::TextLayout API by removing unused accessors

Also store the Font as a const reference instead of a raw pointer,
since we don't allow a null Font here.
This commit is contained in:
Andreas Kling 2023-01-05 20:41:19 +01:00
parent 65c8cd37e3
commit 6b421fb521
4 changed files with 14 additions and 23 deletions

View file

@ -117,7 +117,7 @@ void Label::size_to_fit()
int Label::text_calculated_preferred_height() const
{
return int(AK::ceil(Gfx::TextLayout(&font(), Utf8View { m_text }, text_rect().to_type<float>()).bounding_rect(Gfx::TextWrapping::Wrap, Gfx::Painter::LINE_SPACING).height()));
return int(AK::ceil(Gfx::TextLayout(font(), Utf8View { m_text }, text_rect().to_type<float>()).bounding_rect(Gfx::TextWrapping::Wrap, Gfx::Painter::LINE_SPACING).height()));
}
Optional<UISize> Label::calculated_preferred_size() const