From bbdfb715a6f925cae4584757ef2b39685f63d597 Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Tue, 18 May 2021 18:38:49 +0200 Subject: Use a non-zero default size for SubViewports This makes viewports visible out of the box. --- doc/classes/SubViewport.xml | 2 +- scene/main/viewport.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/classes/SubViewport.xml b/doc/classes/SubViewport.xml index b6e9eda1d1..f54f22d6fa 100644 --- a/doc/classes/SubViewport.xml +++ b/doc/classes/SubViewport.xml @@ -25,7 +25,7 @@ The update mode when the sub-viewport is used as a render target. - + The width and height of the sub-viewport. diff --git a/scene/main/viewport.h b/scene/main/viewport.h index 2e88e1251d..a55df4fbc2 100644 --- a/scene/main/viewport.h +++ b/scene/main/viewport.h @@ -231,7 +231,7 @@ private: Transform2D global_canvas_transform; Transform2D stretch_transform; - Size2i size; + Size2i size = Size2i(512, 512); Size2i size_2d_override; bool size_allocated = false; bool use_xr = false; -- cgit v1.2.3