From 772507f1f474d4ceee03e8e10f3628364aa33219 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 12 Nov 1999 14:55:37 +0000 Subject: [PATCH] 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 --- src/common/wincmn.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 -- 2.47.2