Commit 05d81656 authored by Luis Javier Merino's avatar Luis Javier Merino Committed by Kurt Hindenburg
Browse files

Do not reflow double-height lines

Double height lines are actually two lines, the first with the top part
of the characters, the second with the bottom part. Reflowing could lead
to situations where we render a top part, a double height line with its
top and bottom parts, and a bottom part, which looks weird.
parent 3cd160f5
...@@ -486,7 +486,7 @@ void Screen::resizeImage(int new_lines, int new_columns) ...@@ -486,7 +486,7 @@ void Screen::resizeImage(int new_lines, int new_columns)
} }
// If need to move to line below, copy from the current line, to the next one. // If need to move to line below, copy from the current line, to the next one.
if (lineSize > new_columns) { if (lineSize > new_columns && !(_lineProperties[currentPos] & (LINE_DOUBLEHEIGHT_BOTTOM | LINE_DOUBLEHEIGHT_TOP))) {
auto values = _screenLines[currentPos].mid(new_columns); auto values = _screenLines[currentPos].mid(new_columns);
_screenLines[currentPos].resize(new_columns); _screenLines[currentPos].resize(new_columns);
_lineProperties.insert(currentPos + 1, _lineProperties[currentPos]); _lineProperties.insert(currentPos + 1, _lineProperties[currentPos]);
......
...@@ -163,7 +163,7 @@ int HistoryScrollFile::reflowLines(int columns) ...@@ -163,7 +163,7 @@ int HistoryScrollFile::reflowLines(int columns)
} }
// Now reflow the lines // Now reflow the lines
while (reflowLineLen(startLine, endLine) > columns) { while (reflowLineLen(startLine, endLine) > columns && !(lineProperty & (LINE_DOUBLEHEIGHT_BOTTOM | LINE_DOUBLEHEIGHT_TOP))) {
startLine += (qint64)columns * sizeof(Character); startLine += (qint64)columns * sizeof(Character);
setNewLine(newLine, startLine, lineProperty | LINE_WRAPPED); setNewLine(newLine, startLine, lineProperty | LINE_WRAPPED);
reflowFile->add(reinterpret_cast<const char *>(&newLine), sizeof(reflowData)); reflowFile->add(reinterpret_cast<const char *>(&newLine), sizeof(reflowData));
......
...@@ -186,7 +186,7 @@ int CompactHistoryScroll::reflowLines(int columns) ...@@ -186,7 +186,7 @@ int CompactHistoryScroll::reflowLines(int columns)
} }
// if the current line > columns it will need a new line // if the current line > columns it will need a new line
if (curr_linelen > columns) { if (curr_linelen > columns && !(getLineProperty(currentPos) & (LINE_DOUBLEHEIGHT_BOTTOM | LINE_DOUBLEHEIGHT_TOP))) {
bool removeLine = getLines() == getMaxLines(); bool removeLine = getLines() == getMaxLines();
auto *curr_line = getCharacterBuffer(curr_linelen); auto *curr_line = getCharacterBuffer(curr_linelen);
LineProperty curr_line_property = getLineProperty(currentPos); LineProperty curr_line_property = getLineProperty(currentPos);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment