mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 02:07: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) {
|
} else if (alignment == TextAlignment::Center) {
|
||||||
int textWidth = text.length() * m_font.glyphWidth();
|
int textWidth = text.length() * m_font.glyphWidth();
|
||||||
point = rect.center();
|
point = rect.center();
|
||||||
point.moveBy(-(textWidth / 2), -(m_font.glyphWidth() / 2));
|
point.moveBy(-(textWidth / 2), -(m_font.glyphHeight() / 2));
|
||||||
} else {
|
} else {
|
||||||
ASSERT_NOT_REACHED();
|
ASSERT_NOT_REACHED();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue