From ff0ce2b92192ceda46a0267c48f532b48c61f9c3 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Fri, 12 Oct 2018 16:57:43 +0200 Subject: [PATCH] Painter::TextAlignment::Center vertical fix. --- Widgets/Painter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Widgets/Painter.cpp b/Widgets/Painter.cpp index 63b81bdf25..3cdd982a32 100644 --- a/Widgets/Painter.cpp +++ b/Widgets/Painter.cpp @@ -105,7 +105,7 @@ void Painter::drawText(const Rect& rect, const String& text, TextAlignment align } else if (alignment == TextAlignment::Center) { int textWidth = text.length() * m_font.glyphWidth(); point = rect.center(); - point.moveBy(-(textWidth / 2), -(m_font.glyphWidth() / 2)); + point.moveBy(-(textWidth / 2), -(m_font.glyphHeight() / 2)); } else { ASSERT_NOT_REACHED(); }