Terminal: Fix screen clearing when scrolling
This commit is contained in:
parent
05a727979a
commit
850b3284ac
|
@ -709,7 +709,9 @@ Rectangle Terminal::putcodepoint(uint32_t codepoint)
|
||||||
const uint32_t scroll = m_cursor.y - rows() + 1;
|
const uint32_t scroll = m_cursor.y - rows() + 1;
|
||||||
m_cursor.y -= scroll;
|
m_cursor.y -= scroll;
|
||||||
texture.shift_vertical(-scroll * (int32_t)m_font.height());
|
texture.shift_vertical(-scroll * (int32_t)m_font.height());
|
||||||
texture.fill_rect(0, m_window->width() - scroll * m_font.width(), m_window->width(), scroll * m_font.height(), m_bg_color);
|
|
||||||
|
const size_t y_off = (rows() - scroll) * m_font.height();
|
||||||
|
texture.fill_rect(0, y_off, m_window->width(), m_window->height() - y_off, m_bg_color);
|
||||||
should_invalidate = { 0, 0, m_window->width(), m_window->height() };
|
should_invalidate = { 0, 0, m_window->width(), m_window->height() };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -737,7 +739,9 @@ Rectangle Terminal::putcodepoint(uint32_t codepoint)
|
||||||
const uint32_t scroll = m_cursor.y - rows() + 1;
|
const uint32_t scroll = m_cursor.y - rows() + 1;
|
||||||
m_cursor.y -= scroll;
|
m_cursor.y -= scroll;
|
||||||
texture.shift_vertical(-scroll * (int32_t)m_font.height());
|
texture.shift_vertical(-scroll * (int32_t)m_font.height());
|
||||||
texture.fill_rect(0, m_window->width() - scroll * m_font.width(), m_window->width(), scroll * m_font.height(), m_bg_color);
|
|
||||||
|
const size_t y_off = (rows() - scroll) * m_font.height();
|
||||||
|
texture.fill_rect(0, y_off, m_window->width(), m_window->height() - y_off, m_bg_color);
|
||||||
should_invalidate = { 0, 0, m_window->width(), m_window->height() };
|
should_invalidate = { 0, 0, m_window->width(), m_window->height() };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue