]> git.saurik.com Git - wxWidgets.git/commitdiff
Centre() centers the window centre and not the upper left corner
authorVadim Zeitlin <vadim@wxwidgets.org>
Fri, 12 Nov 1999 14:55:37 +0000 (14:55 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Fri, 12 Nov 1999 14:55:37 +0000 (14:55 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4517 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/wincmn.cpp

index a9f702acfd5302368338b0a670741d31e061be9d..9cad968ed4eb27107557a43ecd39cd2f097ce6d2 100644 (file)
@@ -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