From 8775b357008a14fd2acdd2e2c70600f1c6346504 Mon Sep 17 00:00:00 2001 From: "Unknown (NI)" Date: Sat, 11 Mar 2000 03:05:27 +0000 Subject: [PATCH] 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 --- src/generic/scrolwin.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/generic/scrolwin.cpp b/src/generic/scrolwin.cpp index 3de943ec7c..1a8af01547 100644 --- a/src/generic/scrolwin.cpp +++ b/src/generic/scrolwin.cpp @@ -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;