1
0
Fork 0

Prevent warning emitting from `SubViewport` on scene loading

This commit is contained in:
Chaosus 2025-01-10 15:31:50 +03:00
parent 24d74510e5
commit ca850cc0dd
1 changed files with 1 additions and 1 deletions

View File

@ -5169,7 +5169,7 @@ void SubViewport::set_size_force(const Size2i &p_size) {
void SubViewport::_internal_set_size(const Size2i &p_size, bool p_force) {
SubViewportContainer *c = Object::cast_to<SubViewportContainer>(get_parent());
if (!p_force && c && c->is_stretch_enabled()) {
if (!p_force && c && c->is_inside_tree() && c->is_stretch_enabled()) {
#ifdef DEBUG_ENABLED
WARN_PRINT("Can't change the size of a `SubViewport` with a `SubViewportContainer` parent that has `stretch` enabled. Set `SubViewportContainer.stretch` to `false` to allow changing the size manually.");
#endif // DEBUG_ENABLED