diff options
author | FireForge <67974470+fire-forge@users.noreply.github.com> | 2022-04-07 17:46:49 -0500 |
---|---|---|
committer | FireForge <67974470+fire-forge@users.noreply.github.com> | 2022-04-12 08:30:24 -0500 |
commit | 0b0a74e135846b15485eea6e92975e2182edccdc (patch) | |
tree | 5c875263a066127b30739c7480a433c1cb428f5f /scene | |
parent | 43f94c95aa88d5fc0180bb4ee5c8ce44d27dbc0f (diff) |
Redesign InputEvent editor plugin
- Use vertical layout and add text wrapping
- Fix Window.popup_centered() rect calculation
Diffstat (limited to 'scene')
-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); |