diff options
Diffstat (limited to 'Widgets/TerminalWidget.cpp')
-rw-r--r-- | Widgets/TerminalWidget.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/Widgets/TerminalWidget.cpp b/Widgets/TerminalWidget.cpp index 729cf16b16..56782eba37 100644 --- a/Widgets/TerminalWidget.cpp +++ b/Widgets/TerminalWidget.cpp @@ -14,9 +14,7 @@ TerminalWidget::TerminalWidget(Widget* parent) { g_tw = this; - auto& font = Font::defaultFont(); - - setWindowRelativeRect({ 0, 0, (columns() * font.glyphWidth()) + 4, (rows() * font.glyphHeight()) + 4 }); + setWindowRelativeRect({ 0, 0, (columns() * font().glyphWidth()) + 4, (rows() * font().glyphHeight()) + 4 }); printf("rekt: %d x %d\n", width(), height()); m_screen = new CharacterWithAttributes[rows() * columns()]; @@ -65,15 +63,13 @@ void TerminalWidget::paintEvent(PaintEvent&) Painter painter(*this); painter.fillRect(rect(), Color::Black); - auto& font = Font::defaultFont(); - char buf[2] = { 0, 0 }; for (unsigned row = 0; row < m_rows; ++row) { - int y = row * font.glyphHeight(); + int y = row * font().glyphHeight(); for (unsigned column = 0; column < m_columns; ++column) { - int x = column * font.glyphWidth(); + int x = column * font().glyphWidth(); buf[0] = at(row, column).character; - painter.drawText({ x + 2, y + 2, width(), font.glyphHeight() }, buf, Painter::TextAlignment::TopLeft, Color(0xa0, 0xa0, 0xa0)); + painter.drawText({ x + 2, y + 2, width(), font().glyphHeight() }, buf, Painter::TextAlignment::TopLeft, Color(0xa0, 0xa0, 0xa0)); } } |