From 7445ab95fc0aa8e1129649c3303ad192fae2fc30 Mon Sep 17 00:00:00 2001 From: Markus Sauermann <6299227+Sauermann@users.noreply.github.com> Date: Mon, 7 Nov 2022 09:23:32 +0100 Subject: 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. --- scene/main/viewport.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'scene/main') 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() {} -- cgit v1.2.3