mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 16:37:35 +00:00
Painter::TextAlignment::Center vertical fix.
This commit is contained in:
parent
0dcdbe3e03
commit
ff0ce2b921
1 changed files with 1 additions and 1 deletions
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue