mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-08 09:09:43 +00:00
Terminal: Constrain the cursor inside the terminal rect.
This commit is contained in:
parent
333aa1646c
commit
db2422d0d3
Notes:
sideshowbarker
2024-07-19 15:53:14 +09:00
Author: https://github.com/awesomekling
Commit: db2422d0d3
1 changed files with 3 additions and 1 deletions
|
@ -407,8 +407,10 @@ void Terminal::scroll_up()
|
|||
set_cursor(new_row, 0);
|
||||
}
|
||||
|
||||
void Terminal::set_cursor(unsigned row, unsigned column)
|
||||
void Terminal::set_cursor(unsigned a_row, unsigned a_column)
|
||||
{
|
||||
unsigned row = min(a_row, m_rows - 1u);
|
||||
unsigned column = min(a_column, m_columns - 1u);
|
||||
if (row == m_cursor_row && column == m_cursor_column)
|
||||
return;
|
||||
ASSERT(row < rows());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue