X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/86a41088fde89a7e387145c4872eecd7346ac776..88b9909d1a4f51b23d35a672bc404eb59d25eb75:/src/univ/textctrl.cpp diff --git a/src/univ/textctrl.cpp b/src/univ/textctrl.cpp index 605ac422cd..00e987b800 100644 --- a/src/univ/textctrl.cpp +++ b/src/univ/textctrl.cpp @@ -1965,7 +1965,7 @@ void wxTextCtrl::ShowPosition(wxTextPos pos) { // finding the last line is easy if each line has exactly // one row - yEnd = yStart + rectText.height / GetLineHeight() - 1; + yEnd = yStart + rectText.height / GetLineHeight(); } if ( yEnd < y ) @@ -2418,7 +2418,7 @@ void wxTextCtrl::UpdateTextRect() WData().m_rowFirstInvalid = 0; // increase timestamp: this means that the lines which had been - // laid out before will be relayd out the next time LayoutLines() + // laid out before will be relaid out the next time LayoutLines() // is called because their timestamp will be smaller than the // current one WData().m_timestamp++; @@ -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