diff --git a/src/generic/scrlwing.cpp b/src/generic/scrlwing.cpp index c8256d61ca..aa269504c9 100644 --- a/src/generic/scrlwing.cpp +++ b/src/generic/scrlwing.cpp @@ -767,10 +767,8 @@ bool wxScrollHelperBase::ScrollLayout() // If we're the scroll target, take into account the // virtual size and scrolled position of the window. - int x = 0, y = 0, w = 0, h = 0; - CalcScrolledPosition(0,0, &x,&y); - m_win->GetVirtualSize(&w, &h); - m_win->GetSizer()->SetDimension(x, y, w, h); + m_win->GetSizer()->SetDimension(CalcScrolledPosition(wxPoint(0, 0)), + m_win->GetVirtualSize()); return true; }