small change to avoid floating point exception in wxScrolledWindow::Scroll
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6607 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
b7e1921351
commit
8775b35700
@ -519,7 +519,7 @@ void wxScrolledWindow::Scroll( int x_pos, int y_pos )
|
||||
int w, h;
|
||||
m_targetWindow->GetClientSize(&w, &h);
|
||||
|
||||
if (x_pos != -1)
|
||||
if ((x_pos != -1) && (m_xScrollPixelsPerLine))
|
||||
{
|
||||
int old_x = m_xScrollPosition;
|
||||
m_xScrollPosition = x_pos;
|
||||
@ -539,7 +539,7 @@ void wxScrolledWindow::Scroll( int x_pos, int y_pos )
|
||||
m_targetWindow->SetScrollPos( wxHORIZONTAL, m_xScrollPosition, TRUE );
|
||||
m_targetWindow->ScrollWindow( (old_x-m_xScrollPosition)*m_xScrollPixelsPerLine, 0 );
|
||||
}
|
||||
if (y_pos != -1)
|
||||
if ((y_pos != -1) && (m_yScrollPixelsPerLine))
|
||||
{
|
||||
int old_y = m_yScrollPosition;
|
||||
m_yScrollPosition = y_pos;
|
||||
|
Loading…
Reference in New Issue
Block a user