From: Vadim Zeitlin Date: Fri, 12 Nov 1999 14:55:37 +0000 (+0000) Subject: Centre() centers the window centre and not the upper left corner X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/772507f1f474d4ceee03e8e10f3628364aa33219 Centre() centers the window centre and not the upper left corner git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4517 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/common/wincmn.cpp b/src/common/wincmn.cpp index a9f702acfd..9cad968ed4 100644 --- a/src/common/wincmn.cpp +++ b/src/common/wincmn.cpp @@ -354,7 +354,9 @@ void wxWindowBase::Centre(int direction) yNew += posParent.y; } - Move(xNew, yNew); + // move the centre of this window to this position (not the upper left + // corner as it was done before) + Move(xNew - width / 2, yNew - height / 2); } // fits the window around the children