small change to avoid floating point exception in wxScrolledWindow::Scroll
authorUnknown (NI) <nobody@localhost>
Sat, 11 Mar 2000 03:05:27 +0000 (03:05 +0000)
committerUnknown (NI) <nobody@localhost>
Sat, 11 Mar 2000 03:05:27 +0000 (03:05 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6607 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/generic/scrolwin.cpp

index 3de943ec7cb5dba29d1f500b48f14f80f2a364d8..1a8af0154780f89b361827a302df0e499aae5ebc 100644 (file)
@@ -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;