mirror of
https://github.com/autc04/Retro68.git
synced 2026-04-26 11:27:07 +00:00
Update Console.cc
Fix an issue with the text being blinky when using the EraseInLine() function.
This commit is contained in:
@@ -888,7 +888,12 @@ void Console::ClearFromCursorToEndOfLine()
|
||||
std::fill(onscreen.begin() + currentPosition, onscreen.begin() + endOfLinePosition, AttributedChar(' ', currentAttr));
|
||||
|
||||
Update();
|
||||
Draw(bounds);
|
||||
|
||||
// Erase only on the line the cursor is on
|
||||
Rect rect;
|
||||
rect = CellRect(cursorX, cursorY);
|
||||
rect.right = cols * cellSizeX;
|
||||
EraseRect(&rect);
|
||||
}
|
||||
|
||||
// Erases from the beginning of the line to the cursor's position
|
||||
@@ -902,7 +907,12 @@ void Console::ClearFromBeginningOfLineToCursor()
|
||||
std::fill(onscreen.begin() + beginningOfLinePosition, onscreen.begin() + currentPosition, AttributedChar(' ', currentAttr));
|
||||
|
||||
Update();
|
||||
Draw(bounds);
|
||||
|
||||
// Erase only on the line the cursor is on
|
||||
Rect rect;
|
||||
rect = CellRect(0, cursorY);
|
||||
rect.right = GetCursorX() * cellSizeX;
|
||||
EraseRect(&rect);
|
||||
}
|
||||
|
||||
// Erases the entire line the cursor is on
|
||||
@@ -916,7 +926,12 @@ void Console::ClearEntireLine()
|
||||
std::fill(onscreen.begin() + beginningOfLinePosition, onscreen.begin() + endOfLinePosition, AttributedChar(' ', currentAttr));
|
||||
|
||||
Update();
|
||||
Draw(bounds);
|
||||
|
||||
// Erase only the line the cursor is on
|
||||
Rect rect;
|
||||
rect = CellRect(0, cursorY);
|
||||
rect.right = cols * cellSizeX;
|
||||
EraseRect(&rect);
|
||||
}
|
||||
|
||||
// Bound to ANSI escape code h
|
||||
@@ -963,4 +978,4 @@ void Console::SetCursorY(int newY)
|
||||
int Console::GetCursorY()
|
||||
{
|
||||
return cursorY + 1;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user