From c74fb776036fca0dce97518dff17a3d4be8ddf82 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 ba565c799..8972e07c6 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)