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

LibGfx: Avoid rounding/truncating glyph positions till blitting

This keeps some overloads that accept ints to avoid adding calls to
.to_type<float>() all over the place.
This commit is contained in:
MacDue 2023-01-01 19:42:00 +01:00 committed by Andreas Kling
parent 68f678f566
commit a1726b1ba5
14 changed files with 172 additions and 106 deletions

View file

@ -117,7 +117,7 @@ void Label::size_to_fit()
int Label::text_calculated_preferred_height() const
{
return Gfx::TextLayout(&font(), Utf8View { m_text }, text_rect()).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