Eliminate apparently unnecessary updates in SetScrollbars.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6180 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Neis
2000-02-21 17:10:39 +00:00
parent b32719cc03
commit b0486e0dc3

View File

@@ -129,16 +129,20 @@ void wxScrolledWindow::SetScrollbars (int pixelsPerUnitX, int pixelsPerUnitY,
int noUnitsX, int noUnitsY, int noUnitsX, int noUnitsY,
int xPos, int yPos, bool noRefresh ) int xPos, int yPos, bool noRefresh )
{ {
int xpos, ypos;
CalcUnscrolledPosition(xPos, yPos, &xpos, &ypos);
bool do_refresh = bool do_refresh =
( (
(noUnitsX != 0 && m_xScrollLines == 0) || (noUnitsX != 0 && m_xScrollLines == 0) ||
(noUnitsX < m_xScrollLines) || (noUnitsX < m_xScrollLines && xpos > pixelsPerUnitX*noUnitsX) ||
(noUnitsY != 0 && m_yScrollLines == 0) || (noUnitsY != 0 && m_yScrollLines == 0) ||
(noUnitsY < m_yScrollLines) || (noUnitsY < m_yScrollLines && ypos > pixelsPerUnitY*noUnitsY) ||
(xPos != m_xScrollPosition) || (xPos != m_xScrollPosition) ||
(yPos != m_yScrollPosition) || (yPos != m_yScrollPosition)
(pixelsPerUnitX != m_xScrollPixelsPerLine) || // (pixelsPerUnitX != m_xScrollPixelsPerLine) ||
(pixelsPerUnitY != m_yScrollPixelsPerLine) // (pixelsPerUnitY != m_yScrollPixelsPerLine)
); );
m_xScrollPixelsPerLine = pixelsPerUnitX; m_xScrollPixelsPerLine = pixelsPerUnitX;