Browse Source

Merge pull request #48814 from Calinou/viewport-use-nonzero-default-size

Use a non-zero default size for SubViewports
Rémi Verschelde 4 years ago
parent
commit
d0aaf4a1fd
2 changed files with 2 additions and 2 deletions
  1. 1 1
      doc/classes/SubViewport.xml
  2. 1 1
      scene/main/viewport.h

+ 1 - 1
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 )">

+ 1 - 1
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;