From 9d93472298f3f6b44e7862e227aef6f96527cca8 Mon Sep 17 00:00:00 2001 From: Stephen Anthony Date: Mon, 18 Dec 2017 15:19:19 -0330 Subject: [PATCH] Oops, forgot this one in the last commit. --- src/gui/Dialog.cxx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/gui/Dialog.cxx b/src/gui/Dialog.cxx index a6ecbef68..8d7805024 100644 --- a/src/gui/Dialog.cxx +++ b/src/gui/Dialog.cxx @@ -106,9 +106,8 @@ void Dialog::center() if(_surface) { const GUI::Size& screen = instance().frameBuffer().screenSize(); - uInt32 x = (screen.w - getWidth()) >> 1; - uInt32 y = (screen.h - getHeight()) >> 1; - _surface->setDstPos(x, y); + const GUI::Rect& dst = _surface->dstRect(); + _surface->setDstPos((screen.w - dst.width()) >> 1, (screen.h - dst.height()) >> 1); } }