X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ba81034d1a2fc216b0da7fca140d2b786478862b..c81f40e0fe3ea56c7291a83045419455649809f4:/src/common/wincmn.cpp diff --git a/src/common/wincmn.cpp b/src/common/wincmn.cpp index ca0f43b5f9..59f3a09ffb 100644 --- a/src/common/wincmn.cpp +++ b/src/common/wincmn.cpp @@ -393,8 +393,9 @@ void wxWindowBase::Centre(int direction) xNew += posParent.x; yNew += posParent.y; - // move the centre of this window to this position - Move(xNew, yNew); + // move the window to this position (keeping the old size but using + // SetSize() and not Move() to allow xNew and/or yNew to be -1) + SetSize(xNew, yNew, width, height, wxSIZE_ALLOW_MINUS_ONE); } // fits the window around the children