correction for Fit() which didn't handle properly windows positioned at (-1, -1)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6338 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2000-02-28 19:07:20 +00:00
parent cc023d9fd9
commit 3f5513f5bb

View File

@@ -403,6 +403,14 @@ wxSize wxWindowBase::DoGetBestSize() const
int wx, wy, ww, wh; int wx, wy, ww, wh;
win->GetPosition(&wx, &wy); win->GetPosition(&wx, &wy);
// if the window hadn't been positioned yet, assume that it is in
// the origin
if ( wx == -1 )
wx = 0;
if ( wy == -1 )
wy = 0;
win->GetSize(&ww, &wh); win->GetSize(&ww, &wh);
if ( wx + ww > maxX ) if ( wx + ww > maxX )
maxX = wx + ww; maxX = wx + ww;