[Game] Fix game log first line incorrect background color

This commit is contained in:
RickyRister 2026-02-21 03:59:43 -08:00
parent 6ab558dd58
commit 1cc1b5d8c6

View file

@ -75,8 +75,14 @@ void ChatView::adjustColorsToPalette()
void ChatView::refreshBlockColors()
{
QTextDocument *doc = document();
QTextCursor cursor(doc);
// Empty QTextDocuments still have 1 block, so we need handle this edge case
if (doc->isEmpty()) {
evenNumber = true;
return;
}
QTextCursor cursor(doc);
bool even = true; // start fresh
for (QTextBlock block = doc->begin(); block.isValid(); block = block.next()) {