X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/844adaa47ae9928450affcaaee0209cb36b9c30a..37b5dea730745eae5307324c96a247f30cb5c1ab:/src/generic/scrlwing.cpp diff --git a/src/generic/scrlwing.cpp b/src/generic/scrlwing.cpp index 4578f66193..7add087eda 100644 --- a/src/generic/scrlwing.cpp +++ b/src/generic/scrlwing.cpp @@ -365,7 +365,11 @@ void wxScrollHelper::SetScrollbars(int pixelsPerUnitX, // The above should arguably be deprecated, this however we still need. - m_targetWindow->SetVirtualSize( w, h ); + // take care not to set 0 virtual size, 0 means that we don't have any + // scrollbars and hence we should use the real size instead of the virtual + // one which is indicated by using wxDefaultCoord + m_targetWindow->SetVirtualSize( w ? w : wxDefaultCoord, + h ? h : wxDefaultCoord); if (do_refresh && !noRefresh) m_targetWindow->Refresh(true, GetScrollRect());