From 5945d556a6c373e863672b8bc355c48122de26c2 Mon Sep 17 00:00:00 2001 From: phkahler <14852918+phkahler@users.noreply.github.com> Date: Fri, 6 Nov 2020 19:12:52 -0500 Subject: [PATCH] Add end marker to text window and increase max rows. --- src/textwin.cpp | 11 +++++++++++ src/ui.h | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/textwin.cpp b/src/textwin.cpp index 900a824..e243825 100644 --- a/src/textwin.cpp +++ b/src/textwin.cpp @@ -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); diff --git a/src/ui.h b/src/ui.h index b44d566..a798410 100644 --- a/src/ui.h +++ b/src/ui.h @@ -179,7 +179,7 @@ public: enum { MAX_COLS = 100, MIN_COLS = 45, - MAX_ROWS = 2000 + MAX_ROWS = 4000 }; typedef struct {