summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Sauermann <6299227+Sauermann@users.noreply.github.com>2022-11-07 09:23:32 +0100
committerMarkus Sauermann <6299227+Sauermann@users.noreply.github.com>2022-11-07 09:23:32 +0100
commit7445ab95fc0aa8e1129649c3303ad192fae2fc30 (patch)
tree903777f047439bc243dc2315a90fd40fc90222de
parentbb5b45e95035e1e7ab9d7892553339dff260ff95 (diff)
Fix SubViewport with default size being pink
A SubViewport with default-size doesn't display its content, but shows pink color, until it is resized. This patch makes sure, that the size gets set during initialization.
-rw-r--r--scene/main/viewport.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp
index f8b0a66a71..f4e55c0de3 100644
--- a/scene/main/viewport.cpp
+++ b/scene/main/viewport.cpp
@@ -4231,6 +4231,8 @@ void SubViewport::_bind_methods() {
BIND_ENUM_CONSTANT(UPDATE_ALWAYS);
}
-SubViewport::SubViewport() {}
+SubViewport::SubViewport() {
+ RS::get_singleton()->viewport_set_size(get_viewport_rid(), get_size().width, get_size().height);
+}
SubViewport::~SubViewport() {}