1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 08:27:45 +00:00

Terminal: Use the same cursor rect for active/inactive windows.

This commit is contained in:
Andreas Kling 2019-02-08 00:21:02 +01:00
parent 6d7f000ffc
commit 04378d9063

View file

@ -664,8 +664,7 @@ void Terminal::paint()
char ch = line.characters[column]; char ch = line.characters[column];
auto character_rect = glyph_rect(row, column); auto character_rect = glyph_rect(row, column);
if (!has_only_one_background_color || should_reverse_fill_for_cursor) { if (!has_only_one_background_color || should_reverse_fill_for_cursor) {
auto cell_rect = character_rect; auto cell_rect = character_rect.inflated(0, m_line_spacing);
cell_rect.inflate(0, m_line_spacing);
painter.fill_rect(cell_rect, lookup_color(should_reverse_fill_for_cursor ? attribute.foreground_color : attribute.background_color)); painter.fill_rect(cell_rect, lookup_color(should_reverse_fill_for_cursor ? attribute.foreground_color : attribute.background_color));
} }
if (ch == ' ') if (ch == ' ')
@ -675,8 +674,8 @@ void Terminal::paint()
} }
if (!m_in_active_window) { if (!m_in_active_window) {
auto cursor_rect = glyph_rect(m_cursor_row, m_cursor_column); auto cell_rect = glyph_rect(m_cursor_row, m_cursor_column).inflated(0, m_line_spacing);
painter.draw_rect(cursor_rect, lookup_color(line(m_cursor_row).attributes[m_cursor_column].foreground_color)); painter.draw_rect(cell_rect, lookup_color(line(m_cursor_row).attributes[m_cursor_column].foreground_color));
} }
line(m_cursor_row).did_paint = true; line(m_cursor_row).did_paint = true;