mirror of
https://github.com/ksherlock/TwoTerm.git
synced 2025-01-18 14:33:30 +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,7 +868,23 @@ void Screen::setSize(unsigned w, unsigned h)
|
|||||||
else if (height() > h)
|
else if (height() > h)
|
||||||
{
|
{
|
||||||
unsigned count = 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.
|
// erase lines from the top.
|
||||||
|
if (count)
|
||||||
_screen.erase(_screen.begin(), _screen.begin() + count);
|
_screen.erase(_screen.begin(), _screen.begin() + count);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user