mirror of
https://github.com/ksherlock/TwoTerm.git
synced 2025-01-03 07:29:28 +00:00
resize by deleting lines below cursor first.
git-svn-id: svn://qnap.local/TwoTerm/trunk@1993 5590a31f-7b70-45f8-8c82-aa3a8e5f4507
This commit is contained in:
parent
5252d7c61d
commit
4020395d97
@ -868,8 +868,24 @@ void Screen::setSize(unsigned w, unsigned h)
|
||||
else if (height() > h)
|
||||
{
|
||||
unsigned count = height() - h;
|
||||
int y = _port.cursor.y;
|
||||
int maxY = height() - 1;
|
||||
|
||||
// 1. erase from the bottom, up to the cursor (if blank)
|
||||
// 2. erase lines from the top.
|
||||
|
||||
while (count && maxY > y)
|
||||
{
|
||||
// todo -- check if blank...
|
||||
_screen.pop_back();
|
||||
--count;
|
||||
--maxY;
|
||||
}
|
||||
|
||||
|
||||
// erase lines from the top.
|
||||
_screen.erase(_screen.begin(), _screen.begin() + count);
|
||||
if (count)
|
||||
_screen.erase(_screen.begin(), _screen.begin() + count);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user