X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2b43d5885d32e38f89814eec6c97cc2141458137..7b3dba492726e80855b2f348433338e6561c7bfb:/src/generic/scrlwing.cpp diff --git a/src/generic/scrlwing.cpp b/src/generic/scrlwing.cpp index c78ebc0fa7..606207d260 100644 --- a/src/generic/scrlwing.cpp +++ b/src/generic/scrlwing.cpp @@ -963,22 +963,17 @@ void wxScrollHelper::DoCalcUnscrolledPosition(int x, int y, int *xx, int *yy) co // Default OnSize resets scrollbars, if any void wxScrollHelper::HandleOnSize(wxSizeEvent& WXUNUSED(event)) { - if( m_win->GetAutoLayout() || m_targetWindow->GetAutoLayout() ) + if ( m_targetWindow->GetAutoLayout() ) { - if ( m_targetWindow != m_win ) - m_targetWindow->FitInside(); - - m_win->FitInside(); - - // FIXME: Something is really weird here... This should be - // called by FitInside above (and apparently is), yet the - // scrollsub sample will get the scrollbar wrong if resized - // quickly. This masks the bug, but is surely not the right - // answer at all. - AdjustScrollbars(); + wxSize size = m_targetWindow->GetBestVirtualSize(); + + // This will call ::Layout() and ::AdjustScrollbars() + m_win->SetVirtualSize( size ); } else + { AdjustScrollbars(); + } } // This calls OnDraw, having adjusted the origin according to the current