Keep the lines property

Instead of assign LINE_DEFAULT to next line, it will keep the current
line property.
wilder
Carlos Alves 5 years ago committed by Tomaz Canabrava
parent bccd0a3fcd
commit 155cedeca2
  1. 6
      src/Screen.cpp

@ -377,7 +377,7 @@ void Screen::resizeImage(int new_lines, int new_columns)
int currentPos = 0;
int count_needed_lines = 0;
while (currentPos != _screenLines.count() - 1) {
// if the line have the 'NextLine' char, concat with the next line and remove it.
// if the line have the 'LINE_WRAPPED' property, concat with the next line and remove it.
if ((_lineProperties[currentPos] & LINE_WRAPPED) != 0) {
_screenLines[currentPos].append(_screenLines[currentPos + 1]);
_screenLines.remove(currentPos + 1);
@ -417,9 +417,9 @@ void Screen::resizeImage(int new_lines, int new_columns)
auto values = _screenLines[currentPos].mid(new_columns);
_screenLines[currentPos].remove(new_columns, values.size());
_lineProperties[currentPos] = _lineProperties[currentPos] | LINE_WRAPPED;
_lineProperties.insert(currentPos + 1, _lineProperties[currentPos]);
_screenLines.insert(currentPos + 1, values);
_lineProperties.insert(currentPos + 1, LINE_DEFAULT);
_lineProperties[currentPos] |= LINE_WRAPPED;
}
currentPos += 1;
}

Loading…
Cancel
Save