]> git.saurik.com Git - wxWidgets.git/blobdiff - src/univ/textctrl.cpp
fix for HP and IBM compilers, calls to static template functions must be qualified
[wxWidgets.git] / src / univ / textctrl.cpp
index d8816f8974c3566a829f92a84aed9a5e5f857336..00e987b8005cb36472b0226efb50d52d6b232df3 100644 (file)
@@ -3615,8 +3615,12 @@ void wxTextCtrl::UpdateScrollbars()
 
         if ( scrollRangeXOld )
         {
-            x *= scrollRangeX - m_rectText.width / charWidth;
-            x /= scrollRangeXOld - m_rectText.width / charWidth;
+            const int w = m_rectText.width / charWidth;
+            if ( w != scrollRangeXOld )
+            {
+                x *= scrollRangeX - w;
+                x /= scrollRangeXOld - w;
+            }
             Scroll(x, y);
         }