diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-01-10 05:11:07 +0100 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-01-10 05:11:07 +0100 |
commit | 077f1007ebae7bbe28ec64fcb65de7fabf8c910a (patch) | |
tree | 2f99f3b569492048adcb22ad8f27a76a3503e1f7 /Widgets/Painter.cpp | |
parent | ceb373cf7167b9aed29bf34d847eecf8be778ab7 (diff) | |
download | serenity-077f1007ebae7bbe28ec64fcb65de7fabf8c910a.zip |
More window manager hacking. Get rid of TerminalWidget for now.
Diffstat (limited to 'Widgets/Painter.cpp')
-rw-r--r-- | Widgets/Painter.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Widgets/Painter.cpp b/Widgets/Painter.cpp index 350e39587e..5a1a071d52 100644 --- a/Widgets/Painter.cpp +++ b/Widgets/Painter.cpp @@ -102,6 +102,9 @@ void Painter::drawText(const Rect& rect, const String& text, TextAlignment align if (alignment == TextAlignment::TopLeft) { point = rect.location(); + } else if (alignment == TextAlignment::CenterLeft) { + int textWidth = text.length() * font().glyphWidth(); + point = { rect.x(), rect.center().y() - (font().glyphHeight() / 2) }; } else if (alignment == TextAlignment::Center) { int textWidth = text.length() * font().glyphWidth(); point = rect.center(); |