diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2022-04-12 23:46:56 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-12 23:46:56 +0200 |
commit | 895f2a21f4beea6f4c89d33666bdf3b0925d6db7 (patch) | |
tree | 0a146241304a1a2620802745b1f08b6e2c7a7a02 /scene/main | |
parent | 360fff4ccfd7fb0fa364a21ed1401c81502b5712 (diff) | |
parent | 0b0a74e135846b15485eea6e92975e2182edccdc (diff) |
Merge pull request #60081 from fire-forge/input-event-editor-fix
Redesign InputEvent editor and fix `Window.popup_centered()` rect calculation.
Diffstat (limited to 'scene/main')
-rw-r--r-- | scene/main/window.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/scene/main/window.cpp b/scene/main/window.cpp index 9a7ed1a0ec..8b1a4680d2 100644 --- a/scene/main/window.cpp +++ b/scene/main/window.cpp @@ -1066,11 +1066,9 @@ void Window::popup_centered(const Size2i &p_minsize) { } Rect2i popup_rect; - if (p_minsize == Size2i()) { - popup_rect.size = _get_contents_minimum_size(); - } else { - popup_rect.size = p_minsize; - } + Size2 contents_minsize = _get_contents_minimum_size(); + popup_rect.size.x = MAX(p_minsize.x, contents_minsize.x); + popup_rect.size.y = MAX(p_minsize.y, contents_minsize.y); popup_rect.position = parent_rect.position + (parent_rect.size - popup_rect.size) / 2; popup(popup_rect); |