mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2025-08-13 12:50:47 +00:00
Clear with buffer clear
This commit is contained in:
@@ -570,7 +570,10 @@ Console::Console(
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void Console::clear() {
|
void Console::clear(bool clear_buffer = false) {
|
||||||
|
if(clear_buffer)
|
||||||
|
buffer.clear();
|
||||||
|
|
||||||
display.fill_rectangle(
|
display.fill_rectangle(
|
||||||
screen_rect(),
|
screen_rect(),
|
||||||
Color::black()
|
Color::black()
|
||||||
@@ -595,10 +598,7 @@ void Console::write(std::string message) {
|
|||||||
pen_color = s.foreground;
|
pen_color = s.foreground;
|
||||||
escape = false;
|
escape = false;
|
||||||
} else {
|
} else {
|
||||||
if (c=='\f') { //Add FORM FEED (clear screen)
|
if (c == '\n') {
|
||||||
clear();
|
|
||||||
buffer.clear();
|
|
||||||
} else if (c == '\n') {
|
|
||||||
crlf();
|
crlf();
|
||||||
} else if (c == '\x1B') {
|
} else if (c == '\x1B') {
|
||||||
escape = true;
|
escape = true;
|
||||||
|
@@ -312,7 +312,7 @@ class Console : public Widget {
|
|||||||
public:
|
public:
|
||||||
Console(Rect parent_rect);
|
Console(Rect parent_rect);
|
||||||
|
|
||||||
void clear();
|
void clear(bool clear_buffer);
|
||||||
void write(std::string message);
|
void write(std::string message);
|
||||||
void writeln(std::string message);
|
void writeln(std::string message);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user