summaryrefslogtreecommitdiff
path: root/Libraries
diff options
context:
space:
mode:
Diffstat (limited to 'Libraries')
-rw-r--r--Libraries/LibGfx/Painter.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/Libraries/LibGfx/Painter.cpp b/Libraries/LibGfx/Painter.cpp
index 9d14df6de8..b6a044b7be 100644
--- a/Libraries/LibGfx/Painter.cpp
+++ b/Libraries/LibGfx/Painter.cpp
@@ -907,6 +907,11 @@ void Painter::draw_text_line(const IntRect& a_rect, const Utf8View& text, const
ASSERT_NOT_REACHED();
}
+ if (is_vertically_centered_text_alignment(alignment)) {
+ int distance_from_baseline_to_bottom = (font.glyph_height() - 1) - font.baseline();
+ rect.move_by(0, distance_from_baseline_to_bottom / 2);
+ }
+
auto point = rect.location();
int space_width = font.glyph_width(' ') + font.glyph_spacing();