From b0486e0dc3206a8752828ad3f64e98abf9ff2947 Mon Sep 17 00:00:00 2001 From: Stefan Neis Date: Mon, 21 Feb 2000 17:10:39 +0000 Subject: [PATCH] Eliminate apparently unnecessary updates in SetScrollbars. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6180 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/generic/scrolwin.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/generic/scrolwin.cpp b/src/generic/scrolwin.cpp index 74b4d6bbd2..1c28693778 100644 --- a/src/generic/scrolwin.cpp +++ b/src/generic/scrolwin.cpp @@ -129,16 +129,20 @@ void wxScrolledWindow::SetScrollbars (int pixelsPerUnitX, int pixelsPerUnitY, int noUnitsX, int noUnitsY, int xPos, int yPos, bool noRefresh ) { + int xpos, ypos; + + CalcUnscrolledPosition(xPos, yPos, &xpos, &ypos); bool do_refresh = ( (noUnitsX != 0 && m_xScrollLines == 0) || - (noUnitsX < m_xScrollLines) || + (noUnitsX < m_xScrollLines && xpos > pixelsPerUnitX*noUnitsX) || + (noUnitsY != 0 && m_yScrollLines == 0) || - (noUnitsY < m_yScrollLines) || + (noUnitsY < m_yScrollLines && ypos > pixelsPerUnitY*noUnitsY) || (xPos != m_xScrollPosition) || - (yPos != m_yScrollPosition) || - (pixelsPerUnitX != m_xScrollPixelsPerLine) || - (pixelsPerUnitY != m_yScrollPixelsPerLine) + (yPos != m_yScrollPosition) +// (pixelsPerUnitX != m_xScrollPixelsPerLine) || +// (pixelsPerUnitY != m_yScrollPixelsPerLine) ); m_xScrollPixelsPerLine = pixelsPerUnitX; -- 2.45.2