Add end marker to text window and increase max rows.

This commit is contained in:
phkahler 2020-11-06 19:12:52 -05:00 committed by Koen Schmeets
parent 953c472897
commit 5945d556a6
2 changed files with 12 additions and 1 deletions

View File

@ -338,11 +338,22 @@ void TextWindow::ClearScreen() {
rows = 0;
}
// This message was addded when someone had too many fonts for the text window
// Scrolling seemed to be broken, but was actaully at the MAX_ROWS.
static const char* endString = " **** End of Text Screen ****";
void TextWindow::Printf(bool halfLine, const char *fmt, ...) {
if(!canvas) return;
if(rows >= MAX_ROWS) return;
if(rows >= MAX_ROWS-2 && (fmt != endString)) {
// twice due to some half-row issues on resizing
Printf(halfLine, endString);
Printf(halfLine, endString);
return;
}
va_list vl;
va_start(vl, fmt);

View File

@ -179,7 +179,7 @@ public:
enum {
MAX_COLS = 100,
MIN_COLS = 45,
MAX_ROWS = 2000
MAX_ROWS = 4000
};
typedef struct {