mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-22 17:31:58 -05:00
Improve TextBox text placement a little bit.
This commit is contained in:
parent
d305c316e1
commit
e9e7f7a714
1 changed files with 1 additions and 1 deletions
|
@ -42,12 +42,12 @@ void TextBox::paintEvent(PaintEvent&)
|
|||
int firstVisibleChar = max((int)m_cursorPosition - (int)maxCharsToPaint, 0);
|
||||
unsigned charsToPaint = min(m_text.length() - firstVisibleChar, maxCharsToPaint);
|
||||
|
||||
int y = innerRect.center().y() - font.glyphHeight() / 2;
|
||||
for (unsigned i = 0; i < charsToPaint; ++i) {
|
||||
char ch = m_text[firstVisibleChar + i];
|
||||
if (ch == ' ')
|
||||
continue;
|
||||
int x = innerRect.x() + (i * font.glyphWidth());
|
||||
int y = innerRect.y();
|
||||
auto* bitmap = font.glyphBitmap(ch);
|
||||
if (!bitmap) {
|
||||
printf("TextBox: glyph missing: %02x\n", ch);
|
||||
|
|
Loading…
Reference in a new issue