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.
This commit is contained in:
Markus Sauermann 2022-11-07 09:23:32 +01:00
parent bb5b45e950
commit 7445ab95fc
1 changed files with 3 additions and 1 deletions

View File

@ -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() {}