Skip to content

Commit

Permalink
Terminal: Use the same cursor rect for active/inactive windows.
Browse files Browse the repository at this point in the history
  • Loading branch information
awesomekling committed Feb 7, 2019
1 parent 6d7f000 commit 04378d9
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions Terminal/Terminal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -664,8 +664,7 @@ void Terminal::paint()
char ch = line.characters[column];
auto character_rect = glyph_rect(row, column);
if (!has_only_one_background_color || should_reverse_fill_for_cursor) {
auto cell_rect = character_rect;
cell_rect.inflate(0, m_line_spacing);
auto cell_rect = character_rect.inflated(0, m_line_spacing);
painter.fill_rect(cell_rect, lookup_color(should_reverse_fill_for_cursor ? attribute.foreground_color : attribute.background_color));
}
if (ch == ' ')
Expand All @@ -675,8 +674,8 @@ void Terminal::paint()
}

if (!m_in_active_window) {
auto cursor_rect = glyph_rect(m_cursor_row, m_cursor_column);
painter.draw_rect(cursor_rect, lookup_color(line(m_cursor_row).attributes[m_cursor_column].foreground_color));
auto cell_rect = glyph_rect(m_cursor_row, m_cursor_column).inflated(0, m_line_spacing);
painter.draw_rect(cell_rect, lookup_color(line(m_cursor_row).attributes[m_cursor_column].foreground_color));
}

line(m_cursor_row).did_paint = true;
Expand Down

0 comments on commit 04378d9

Please sign in to comment.