From 3f5513f5bb1cb46db13ac38d010458c7e863208c Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 28 Feb 2000 19:07:20 +0000 Subject: [PATCH] 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 --- src/common/wincmn.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/common/wincmn.cpp b/src/common/wincmn.cpp index 4df298217e..01532a8bfb 100644 --- a/src/common/wincmn.cpp +++ b/src/common/wincmn.cpp @@ -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; -- 2.45.2