From 9b353dcfe56e74d6cb9d9446626eda2f7589aa0e Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Wed, 20 Mar 2013 21:43:23 +0100 Subject: [PATCH] * CTextBox::scrollPageUp/Down: Suppress refresh when there is nothing to scroll --- src/gui/widget/textbox.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/gui/widget/textbox.cpp b/src/gui/widget/textbox.cpp index 47b5d0c4c..54f174369 100644 --- a/src/gui/widget/textbox.cpp +++ b/src/gui/widget/textbox.cpp @@ -554,8 +554,10 @@ void CTextBox::scrollPageDown(const int pages) { m_nCurrentPage = m_nNrOfPages - 1; } + int oldCurrentLine = m_nCurrentLine; m_nCurrentLine = m_nCurrentPage * m_nLinesPerPage; - refresh(); + if (oldCurrentLine != m_nCurrentLine) + refresh(); } void CTextBox::scrollPageUp(const int pages) @@ -575,8 +577,10 @@ void CTextBox::scrollPageUp(const int pages) { m_nCurrentPage = 0; } + int oldCurrentLine = m_nCurrentLine; m_nCurrentLine = m_nCurrentPage * m_nLinesPerPage; - refresh(); + if (oldCurrentLine != m_nCurrentLine) + refresh(); } void CTextBox::refresh(void)