summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Locurcio <hugo.locurcio@hugo.pro>2021-05-18 18:38:49 +0200
committerHugo Locurcio <hugo.locurcio@hugo.pro>2021-05-18 18:51:39 +0200
commitbbdfb715a6f925cae4584757ef2b39685f63d597 (patch)
tree26940c25528d58797b0bc1c6da2d0ad3a7065a62
parent20765800803e7864fa6cd0b641c129c349429e6e (diff)
Use a non-zero default size for SubViewports
This makes viewports visible out of the box.
-rw-r--r--doc/classes/SubViewport.xml2
-rw-r--r--scene/main/viewport.h2
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 @@
<member name="render_target_update_mode" type="int" setter="set_update_mode" getter="get_update_mode" enum="SubViewport.UpdateMode" default="2">
The update mode when the sub-viewport is used as a render target.
</member>
- <member name="size" type="Vector2i" setter="set_size" getter="get_size" default="Vector2i( 0, 0 )">
+ <member name="size" type="Vector2i" setter="set_size" getter="get_size" default="Vector2i( 512, 512 )">
The width and height of the sub-viewport.
</member>
<member name="size_2d_override" type="Vector2i" setter="set_size_2d_override" getter="get_size_2d_override" default="Vector2i( 0, 0 )">
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;