diff --git a/Userland/Libraries/LibGUI/Label.cpp b/Userland/Libraries/LibGUI/Label.cpp index a4b88b2040..d222e76b3b 100644 --- a/Userland/Libraries/LibGUI/Label.cpp +++ b/Userland/Libraries/LibGUI/Label.cpp @@ -10,7 +10,6 @@ #include #include #include -#include #include REGISTER_WIDGET(GUI, Label) @@ -117,7 +116,7 @@ void Label::size_to_fit() int Label::text_calculated_preferred_height() const { - return static_cast(ceilf(Gfx::TextLayout(font(), Utf8View { m_text }, text_rect().to_type()).bounding_rect(Gfx::TextWrapping::Wrap).height())); + return static_cast(ceilf(font().preferred_line_height()) * (m_text.count("\n"sv) + 1)); } Optional Label::calculated_preferred_size() const