Use a non-zero default size for SubViewports

This makes viewports visible out of the box.
This commit is contained in:
Hugo Locurcio 2021-05-18 18:38:49 +02:00
parent 2076580080
commit bbdfb715a6
No known key found for this signature in database
GPG key ID: 39E8F8BE30B0A49C
2 changed files with 2 additions and 2 deletions

View file

@ -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 )">

View file

@ -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;