Skip to content

Commit

Permalink
Merge pull request #48814 from Calinou/viewport-use-nonzero-default-size
Browse files Browse the repository at this point in the history
Use a non-zero default size for SubViewports
  • Loading branch information
akien-mga authored May 19, 2021
2 parents c340ed6 + bbdfb71 commit d0aaf4a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion doc/classes/SubViewport.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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 )">
Expand Down
2 changes: 1 addition & 1 deletion scene/main/viewport.h
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ class Viewport : public Node {
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;
Expand Down

0 comments on commit d0aaf4a

Please sign in to comment.