From 879540aec47270e8fe0fd2f83a0894ddb705b010 Mon Sep 17 00:00:00 2001 From: rdb Date: Wed, 10 Oct 2012 07:41:07 +0000 Subject: [PATCH] Fix incorrect centering formula --- panda/src/windisplay/winGraphicsWindow.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/panda/src/windisplay/winGraphicsWindow.cxx b/panda/src/windisplay/winGraphicsWindow.cxx index 6b4e7d1d6d..470dfe2848 100644 --- a/panda/src/windisplay/winGraphicsWindow.cxx +++ b/panda/src/windisplay/winGraphicsWindow.cxx @@ -954,10 +954,10 @@ calculate_metrics(bool fullscreen, DWORD window_style, WINDOW_METRICS &metrics, // A coordinate of -2 means to center the window in its client area. if (metrics.x == -2) { - metrics.x = 0.5 * (_pipe->get_display_width() - _properties.get_x_origin()); + metrics.x = 0.5 * (_pipe->get_display_width() - _properties.get_x_size()); } if (metrics.y == -2) { - metrics.y = 0.5 * (_pipe->get_display_height() - _properties.get_y_origin()); + metrics.y = 0.5 * (_pipe->get_display_height() - _properties.get_y_size()); } _properties.set_origin(metrics.x, metrics.y);