X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/99b4164c2c8eff4441548f9d93dbdcd7891cfb90..8fd7108e7cfd6d3564a71ab5f49c391613e27798:/src/univ/textctrl.cpp diff --git a/src/univ/textctrl.cpp b/src/univ/textctrl.cpp index 42d6364c2b..00e987b800 100644 --- a/src/univ/textctrl.cpp +++ b/src/univ/textctrl.cpp @@ -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); } @@ -4193,6 +4197,7 @@ void wxTextCtrl::DoDraw(wxControlRenderer *renderer) // FIXME: is this really a bug in wxMSW? rectTextArea.width--; #endif // __WXMSW__ + dc.DestroyClippingRegion(); dc.SetClippingRegion(rectTextArea); // adjust for scrolling