Merge pull request #72991 from Sauermann/fix-popup-window-minsize

Fix that `popup_centered` didn't take the window's size into consideration
This commit is contained in:
Rémi Verschelde 2023-02-09 23:42:42 +01:00
commit 1a5f28df20
No known key found for this signature in database
GPG key ID: C3336907360768E1

View file

@ -1462,7 +1462,7 @@ void Window::popup_centered(const Size2i &p_minsize) {
}
Rect2i popup_rect;
popup_rect.size = _clamp_window_size(p_minsize);
popup_rect.size = _clamp_window_size(get_size().max(p_minsize));
if (parent_rect != Rect2()) {
popup_rect.position = parent_rect.position + (parent_rect.size - popup_rect.size) / 2;