From 0fff366e0ff4274c635466c3257a0aa2dcd51204 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 21 Dec 2000 15:55:08 +0000 Subject: [PATCH] fix for -1 coords in wxWindow::Centre git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@8981 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/wincmn.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/common/wincmn.cpp b/src/common/wincmn.cpp index ca0f43b5f9..760d49efc8 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, -1, -1, wxSIZE_ALLOW_MINUS_ONE); } // fits the window around the children -- 2.50.0