crash under FreeBSD corrected (patch by David Hobley)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@813 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -238,38 +238,44 @@ int wxScrolledWindow::CalcScrollInc(wxScrollEvent& event)
|
|||||||
}
|
}
|
||||||
if (orient == wxHORIZONTAL)
|
if (orient == wxHORIZONTAL)
|
||||||
{
|
{
|
||||||
int w, h;
|
if (m_xScrollPixelsPerLine > 0) {
|
||||||
GetClientSize(&w, &h);
|
int w, h;
|
||||||
|
GetClientSize(&w, &h);
|
||||||
|
|
||||||
int nMaxWidth = m_xScrollLines*m_xScrollPixelsPerLine;
|
int nMaxWidth = m_xScrollLines*m_xScrollPixelsPerLine;
|
||||||
int noPositions = (int) ( ((nMaxWidth - w)/(float)m_xScrollPixelsPerLine) + 0.5 );
|
int noPositions = (int) ( ((nMaxWidth - w)/(float)m_xScrollPixelsPerLine) + 0.5 );
|
||||||
if (noPositions < 0)
|
if (noPositions < 0)
|
||||||
noPositions = 0;
|
noPositions = 0;
|
||||||
|
|
||||||
if ( (m_xScrollPosition + nScrollInc) < 0 )
|
if ( (m_xScrollPosition + nScrollInc) < 0 )
|
||||||
nScrollInc = -m_xScrollPosition; // As -ve as we can go
|
nScrollInc = -m_xScrollPosition; // As -ve as we can go
|
||||||
else if ( (m_xScrollPosition + nScrollInc) > noPositions )
|
else if ( (m_xScrollPosition + nScrollInc) > noPositions )
|
||||||
nScrollInc = noPositions - m_xScrollPosition; // As +ve as we can go
|
nScrollInc = noPositions - m_xScrollPosition; // As +ve as we can go
|
||||||
|
}
|
||||||
return nScrollInc;
|
else
|
||||||
|
Refresh();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
int w, h;
|
if (m_yScrollPixelsPerLine > 0) {
|
||||||
GetClientSize(&w, &h);
|
int w, h;
|
||||||
|
GetClientSize(&w, &h);
|
||||||
int nMaxHeight = m_yScrollLines*m_yScrollPixelsPerLine;
|
|
||||||
int noPositions = (int) ( ((nMaxHeight - h)/(float)m_yScrollPixelsPerLine) + 0.5 );
|
int nMaxHeight = m_yScrollLines*m_yScrollPixelsPerLine;
|
||||||
if (noPositions < 0)
|
int noPositions = (int) ( ((nMaxHeight - h)/(float)m_yScrollPixelsPerLine) + 0.5 );
|
||||||
noPositions = 0;
|
if (noPositions < 0)
|
||||||
|
noPositions = 0;
|
||||||
if ( (m_yScrollPosition + nScrollInc) < 0 )
|
|
||||||
nScrollInc = -m_yScrollPosition; // As -ve as we can go
|
if ( (m_yScrollPosition + nScrollInc) < 0 )
|
||||||
else if ( (m_yScrollPosition + nScrollInc) > noPositions )
|
nScrollInc = -m_yScrollPosition; // As -ve as we can go
|
||||||
nScrollInc = noPositions - m_yScrollPosition; // As +ve as we can go
|
else if ( (m_yScrollPosition + nScrollInc) > noPositions )
|
||||||
|
nScrollInc = noPositions - m_yScrollPosition; // As +ve as we can go
|
||||||
return nScrollInc;
|
}
|
||||||
|
else
|
||||||
|
Refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return nScrollInc;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Adjust the scrollbars - new version.
|
// Adjust the scrollbars - new version.
|
||||||
|
Reference in New Issue
Block a user