Clear with buffer clear

This commit is contained in:
eried 2020-06-28 20:06:00 +02:00
parent d175e33990
commit ddffc69937
2 changed files with 6 additions and 6 deletions

View File

@ -570,7 +570,10 @@ Console::Console(
{
}
void Console::clear() {
void Console::clear(bool clear_buffer = false) {
if(clear_buffer)
buffer.clear();
display.fill_rectangle(
screen_rect(),
Color::black()
@ -595,10 +598,7 @@ void Console::write(std::string message) {
pen_color = s.foreground;
escape = false;
} else {
if (c=='\f') { //Add FORM FEED (clear screen)
clear();
buffer.clear();
} else if (c == '\n') {
if (c == '\n') {
crlf();
} else if (c == '\x1B') {
escape = true;

View File

@ -312,7 +312,7 @@ class Console : public Widget {
public:
Console(Rect parent_rect);
void clear();
void clear(bool clear_buffer);
void write(std::string message);
void writeln(std::string message);