X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8ae6ce07de7a5e9dde887ef82a69606108c5e09b..a06066343d670807825adcafebfa4fb8cfff5521:/src/common/wincmn.cpp 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;