summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibGUI
diff options
context:
space:
mode:
authorlanmonster <kyle.lanmon@gmail.com>2022-11-28 09:02:08 -0600
committerAndreas Kling <kling@serenityos.org>2022-11-30 07:57:21 +0100
commit2b7aa4a9716171ab1f798199d741fbfe15d4d061 (patch)
treed0bd74281f93ec9e0434df2e534c7e3de3efc490 /Userland/Libraries/LibGUI
parent67de1a81486e36afc6951a6c7e8273174f042238 (diff)
downloadserenity-2b7aa4a9716171ab1f798199d741fbfe15d4d061.zip
LibGfx+LibGUI: Use constant for line spacing instead of magic number
Diffstat (limited to 'Userland/Libraries/LibGUI')
-rw-r--r--Userland/Libraries/LibGUI/Label.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/Userland/Libraries/LibGUI/Label.cpp b/Userland/Libraries/LibGUI/Label.cpp
index c7d2bb7d5c..df0ace8e4c 100644
--- a/Userland/Libraries/LibGUI/Label.cpp
+++ b/Userland/Libraries/LibGUI/Label.cpp
@@ -117,9 +117,7 @@ void Label::size_to_fit()
int Label::text_calculated_preferred_height() const
{
- // FIXME: The 4 is taken from Gfx::Painter and should be available as
- // a constant instead.
- return Gfx::TextLayout(&font(), Utf8View { m_text }, text_rect()).bounding_rect(Gfx::TextWrapping::Wrap, 4).height();
+ return Gfx::TextLayout(&font(), Utf8View { m_text }, text_rect()).bounding_rect(Gfx::TextWrapping::Wrap, Gfx::Painter::LINE_SPACING).height();
}
Optional<UISize> Label::calculated_preferred_size() const