From 47b098cce603b8ff01aa8121bda2da1514b2b40d Mon Sep 17 00:00:00 2001 From: Paul Cercueil Date: Thu, 17 Apr 2014 20:52:41 +0200 Subject: [PATCH] Fix text in log viewer disappearing when pressing alt-right --- src/textdialog.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/textdialog.cpp b/src/textdialog.cpp index c4f1d19..093131d 100644 --- a/src/textdialog.cpp +++ b/src/textdialog.cpp @@ -144,7 +144,8 @@ void TextDialog::exec() { if (firstRow + rowsPerPage*2 -1 < text->size()) { firstRow += rowsPerPage-1; } else { - firstRow = max(0ul, (unsigned long) (text->size() - rowsPerPage)); + firstRow = text->size() < rowsPerPage ? + 0 : text->size() - rowsPerPage; } break; case InputManager::SETTINGS: