]> git.saurik.com Git - wxWidgets.git/commitdiff
correction for Fit() which didn't handle properly windows positioned at (-1, -1)
authorVadim Zeitlin <vadim@wxwidgets.org>
Mon, 28 Feb 2000 19:07:20 +0000 (19:07 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Mon, 28 Feb 2000 19:07:20 +0000 (19:07 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6338 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/wincmn.cpp

index 4df298217edc9cdbc1047a2cc682099801853f29..01532a8bfb3bde1dce6ef27251205ae161111abe 100644 (file)
@@ -403,6 +403,14 @@ wxSize wxWindowBase::DoGetBestSize() const
 
             int wx, wy, ww, wh;
             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);
             if ( wx + ww > maxX )
                 maxX = wx + ww;