mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-22 09:19:03 +00:00
Painter::TextAlignment::Center vertical fix.
This commit is contained in:
@@ -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();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user