mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-22 12:35:14 +00:00
Terminal: Fix crash when scrolling contents while cursor is on first row.
This commit is contained in:
parent
cfa197f821
commit
b33e367f33
Notes:
sideshowbarker
2024-07-19 15:58:18 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/b33e367f33f
1 changed files with 3 additions and 1 deletions
|
@ -418,6 +418,8 @@ Rect Terminal::row_rect(word row)
|
|||
|
||||
inline Terminal::Attribute& Terminal::attribute_at(word row, word column)
|
||||
{
|
||||
ASSERT(row < m_rows);
|
||||
ASSERT(column < m_columns);
|
||||
return m_attributes[(row * m_columns) + column];
|
||||
}
|
||||
|
||||
|
@ -440,7 +442,7 @@ void Terminal::paint()
|
|||
scanlines_to_copy * m_pixel_width
|
||||
);
|
||||
m_need_full_invalidation = true;
|
||||
attribute_at(m_cursor_row - m_rows_to_scroll_backing_store, m_cursor_column).dirty = true;
|
||||
attribute_at(max(0, m_cursor_row - m_rows_to_scroll_backing_store), m_cursor_column).dirty = true;
|
||||
}
|
||||
m_rows_to_scroll_backing_store = 0;
|
||||
#endif
|
||||
|
|
Loading…
Add table
Reference in a new issue