fix divide by 0 bug in UpdateScrollbars() (part of patch 1716763)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@48721 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -3615,8 +3615,12 @@ void wxTextCtrl::UpdateScrollbars()
|
|||||||
|
|
||||||
if ( scrollRangeXOld )
|
if ( scrollRangeXOld )
|
||||||
{
|
{
|
||||||
x *= scrollRangeX - m_rectText.width / charWidth;
|
const int w = m_rectText.width / charWidth;
|
||||||
x /= scrollRangeXOld - m_rectText.width / charWidth;
|
if ( w != scrollRangeXOld )
|
||||||
|
{
|
||||||
|
x *= scrollRangeX - w;
|
||||||
|
x /= scrollRangeXOld - w;
|
||||||
|
}
|
||||||
Scroll(x, y);
|
Scroll(x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user