From 1510beaf49e51b186f286f1bfeae1b19acfe231e Mon Sep 17 00:00:00 2001 From: Reece Wilson Date: Mon, 8 Aug 2022 00:22:15 +0100 Subject: [PATCH] [*] Superficially fix the ConsoleTTY redraw issue on initial overflow by removing an optimization --- Source/Console/ConsoleTTY/ConsoleTTY.cpp | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/Source/Console/ConsoleTTY/ConsoleTTY.cpp b/Source/Console/ConsoleTTY/ConsoleTTY.cpp index f659e928..ce552f5a 100644 --- a/Source/Console/ConsoleTTY/ConsoleTTY.cpp +++ b/Source/Console/ConsoleTTY/ConsoleTTY.cpp @@ -810,20 +810,18 @@ namespace Aurora::Console::ConsoleTTY { if (this->screenBuffer.size() > maxLines) { - for (int i = startIndex + maxLines; i < this->currentHeight; i++) + // TODO (Reece): Removing optimization bc it was broken. This is a nightmare. + auto indexBeforePadding = (this->GetBannerFootBorder() ? 1 + this->topLogPadding : 0) + this->topLogPaddingExtra; + auto startIndex = this->GetTopBorder() + this->GetBannerLines() + indexBeforePadding; + + for (int i = startIndex; i < this->currentHeight; i++) { this->BlankLine(i); } - TTYScrollBuffer(delta); - - for (int i = indexBeforePadding; i < startIndex; i++) - { - this->BlankLine(i); - } - - forceRedrawIfFalse = true; - drawPos = startIndex + maxLines - delta; + this->screenBuffer.clear(); + addMessages(this->messages); + return true; } else {