Sfoglia il codice sorgente

Minor Terminal tweaks.

Andreas Kling 6 anni fa
parent
commit
a8e42bacf4
2 ha cambiato i file con 3 aggiunte e 3 eliminazioni
  1. 2 2
      Terminal/Terminal.cpp
  2. 1 1
      Widgets/Painter.cpp

+ 2 - 2
Terminal/Terminal.cpp

@@ -11,7 +11,7 @@ void Terminal::create_window()
     auto& font = Font::defaultFont();
 
     m_pixel_width = m_columns * font.glyphWidth() + m_inset * 2;
-    m_pixel_height = (m_rows * (font.glyphHeight() + m_line_spacing)) + (m_inset * 2);
+    m_pixel_height = (m_rows * (font.glyphHeight() + m_line_spacing)) + (m_inset * 2) - m_line_spacing;
 
     GUI_CreateWindowParameters params;
     params.rect = { { 300, 300 }, { m_pixel_width, m_pixel_height } };
@@ -397,7 +397,7 @@ void Terminal::paint()
             char ch = m_buffer[(row * m_columns) + (column)];
             auto& attribute = m_attributes[(row * m_columns) + (column)];
             int x = column * font.glyphWidth();
-            Rect glyph_rect { x + m_inset, y + m_inset, font.glyphWidth(), font.glyphHeight() + m_line_spacing};
+            Rect glyph_rect { x + m_inset, y + m_inset, font.glyphWidth(), font.glyphHeight() + m_line_spacing };
             auto glyph_background = ansi_color(attribute.background_color);
             painter.fill_rect(glyph_rect, glyph_background);
             if (ch == ' ')

+ 1 - 1
Widgets/Painter.cpp

@@ -97,7 +97,7 @@ void Painter::draw_glyph(const Point& point, char ch, Color color)
 {
     auto* bitmap = font().glyphBitmap(ch);
     if (!bitmap) {
-        dbgprintf("Font doesn't have 0x%02x ('%c')\n", ch, ch);
+        dbgprintf("Font doesn't have 0x%02x ('%c')\n", (byte)ch, ch);
         ASSERT_NOT_REACHED();
     }
     int x = point.x();