mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-02 09:52:27 -04:00
Fix incorrect centering formula
This commit is contained in:
parent
850a301352
commit
879540aec4
@ -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.
|
// A coordinate of -2 means to center the window in its client area.
|
||||||
if (metrics.x == -2) {
|
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) {
|
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);
|
_properties.set_origin(metrics.x, metrics.y);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user