mirror of
https://github.com/godotengine/godot.git
synced 2025-02-17 22:43:01 +08:00
Fix that popup_centered
didn't take the window's size into consideration
This commit is contained in:
parent
5c1295dc20
commit
88f4e5cc94
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user