From 25b89aa9621fe09142d6dc18f5ab86df0c139183 Mon Sep 17 00:00:00 2001 From: Matthew Olsson Date: Tue, 18 Jul 2023 18:35:58 -0700 Subject: [PATCH] LibGfx: Replace a magic number in ScaledFont with the calculation This makes the reason for the multiplication much clearer. --- Userland/Libraries/LibGfx/Font/ScaledFont.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibGfx/Font/ScaledFont.cpp b/Userland/Libraries/LibGfx/Font/ScaledFont.cpp index f5022eefcd..d64682a923 100644 --- a/Userland/Libraries/LibGfx/Font/ScaledFont.cpp +++ b/Userland/Libraries/LibGfx/Font/ScaledFont.cpp @@ -22,7 +22,7 @@ ScaledFont::ScaledFont(NonnullRefPtr font, float point_width, float auto metrics = m_font->metrics(m_x_scale, m_y_scale); - m_pixel_size = m_point_height * 1.33333333f; + m_pixel_size = m_point_height * (DEFAULT_DPI / POINTS_PER_INCH); m_pixel_size_rounded_up = static_cast(ceilf(m_pixel_size)); m_pixel_metrics = Gfx::FontPixelMetrics {