diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2022-01-06 16:33:11 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-06 16:33:11 +0100 |
commit | 6ebbdb4a80a4ae6ac83485dc01622d9795c4e451 (patch) | |
tree | c98ef1d89a6526dfc44ccca39b46495a331f6057 /scene | |
parent | df491d2f1ccbd6efddc4ef2240d4b6e2e6a3e240 (diff) | |
parent | e72adab51154805d7f6e3c95ce22f68b001e5af9 (diff) |
Merge pull request #43757 from KoBeWi/minimum_size_changed_bro
Diffstat (limited to 'scene')
-rw-r--r-- | scene/gui/subviewport_container.cpp | 1 | ||||
-rw-r--r-- | scene/main/viewport.cpp | 6 |
2 files changed, 7 insertions, 0 deletions
diff --git a/scene/gui/subviewport_container.cpp b/scene/gui/subviewport_container.cpp index 6cc64e7ada..760144591e 100644 --- a/scene/gui/subviewport_container.cpp +++ b/scene/gui/subviewport_container.cpp @@ -54,6 +54,7 @@ Size2 SubViewportContainer::get_minimum_size() const { void SubViewportContainer::set_stretch(bool p_enable) { stretch = p_enable; + update_minimum_size(); queue_sort(); update(); } diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp index 0a9f98bb2f..3e63ba7869 100644 --- a/scene/main/viewport.cpp +++ b/scene/main/viewport.cpp @@ -48,6 +48,7 @@ #include "scene/gui/label.h" #include "scene/gui/popup.h" #include "scene/gui/popup_menu.h" +#include "scene/gui/subviewport_container.h" #include "scene/main/canvas_layer.h" #include "scene/main/window.h" #include "scene/resources/mesh.h" @@ -3865,6 +3866,11 @@ Viewport::~Viewport() { void SubViewport::set_size(const Size2i &p_size) { _set_size(p_size, _get_size_2d_override(), Rect2i(), _stretch_transform(), true); + + SubViewportContainer *c = Object::cast_to<SubViewportContainer>(get_parent()); + if (c) { + c->update_minimum_size(); + } } Size2i SubViewport::get_size() const { |