* Changed TerminalLine::length from int16 to uint16.
* BasicTerminalBuffer::Init() no longer uses _ClearLines() to clear the screen lines, since that expects the lines to be somewhat valid at least and also needlessly updates the dirty region. * _ClearLines() always clears lines, even if they were empty. This way the "softBreak" flag is cleared too. * Be a bit more careful when multiplying a potentially negative signed number by an unsigned one. Shouldn't have caused a problem in this case, though. Either of the first three items should fix #2379. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25958 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
4c9d4b02ef
commit
17b889de67
@ -135,7 +135,8 @@ BasicTerminalBuffer::Init(int32 width, int32 height, int32 historySize)
|
||||
return error;
|
||||
}
|
||||
|
||||
_ClearLines(0, fHeight - 1);
|
||||
for (int32 i = 0; i < fHeight; i++)
|
||||
fScreen[i]->Clear();
|
||||
|
||||
fDirtyInfo.Reset();
|
||||
|
||||
@ -764,10 +765,10 @@ BasicTerminalBuffer::_ClearLines(int32 first, int32 last)
|
||||
if (firstCleared == -1)
|
||||
firstCleared = i;
|
||||
lastCleared = i;
|
||||
}
|
||||
|
||||
line->Clear();
|
||||
}
|
||||
}
|
||||
|
||||
if (firstCleared >= 0)
|
||||
_Invalidate(firstCleared, lastCleared);
|
||||
@ -864,8 +865,8 @@ BasicTerminalBuffer::_ResizeSimple(int32 width, int32 height,
|
||||
TerminalLine* destLine = lines[i - firstLine];
|
||||
if (width < fWidth)
|
||||
_TruncateLine(sourceLine, width);
|
||||
memcpy(destLine, sourceLine, sizeof(TerminalLine)
|
||||
+ (sourceLine->length - 1) * sizeof(TerminalCell));
|
||||
memcpy(destLine, sourceLine, (int32)sizeof(TerminalLine)
|
||||
+ (sourceLine->length - 1) * (int32)sizeof(TerminalCell));
|
||||
}
|
||||
|
||||
// clear the remaining lines
|
||||
|
@ -17,7 +17,7 @@ struct TerminalCell {
|
||||
|
||||
|
||||
struct TerminalLine {
|
||||
int16 length;
|
||||
uint16 length;
|
||||
bool softBreak; // soft line break
|
||||
TerminalCell cells[1];
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user