summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2019-07-06 21:01:37 +0200
committerGitHub <noreply@github.com>2019-07-06 21:01:37 +0200
commit78c1afe8740101c551a37e0a71f7919e4a6e089e (patch)
tree38c68a36d3557169f062c6819479ae1917a17674
parentda1d5d89fd4a7e43b6b3cec6fd0550c0bc70e02e (diff)
parent8255b88d111dcde6e5eac3d6aabb03cf3df4a25c (diff)
Merge pull request #30363 from YeldhamDev/viewport_size_stretch_property
Make 'size_override_stretch' a property in 'Viewport'
-rw-r--r--doc/classes/Viewport.xml3
-rw-r--r--scene/main/viewport.cpp1
2 files changed, 4 insertions, 0 deletions
diff --git a/doc/classes/Viewport.xml b/doc/classes/Viewport.xml
index a9ffd9f66d..772d20a92e 100644
--- a/doc/classes/Viewport.xml
+++ b/doc/classes/Viewport.xml
@@ -284,6 +284,9 @@
<member name="size" type="Vector2" setter="set_size" getter="get_size" default="Vector2( 0, 0 )">
The width and height of viewport.
</member>
+ <member name="size_override_stretch" type="bool" setter="set_size_override_stretch" getter="is_size_override_stretch_enabled" default="false">
+ If [code]true[/code], the size override affects stretch as well.
+ </member>
<member name="transparent_bg" type="bool" setter="set_transparent_background" getter="has_transparent_background" default="false">
If [code]true[/code], the viewport should render its background as transparent.
</member>
diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp
index 8561d9aedb..334c49f7cc 100644
--- a/scene/main/viewport.cpp
+++ b/scene/main/viewport.cpp
@@ -3064,6 +3064,7 @@ void Viewport::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "arvr"), "set_use_arvr", "use_arvr");
ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "size"), "set_size", "get_size");
+ ADD_PROPERTY(PropertyInfo(Variant::BOOL, "size_override_stretch"), "set_size_override_stretch", "is_size_override_stretch_enabled");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "own_world"), "set_use_own_world", "is_using_own_world");
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "world", PROPERTY_HINT_RESOURCE_TYPE, "World"), "set_world", "get_world");
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "world_2d", PROPERTY_HINT_RESOURCE_TYPE, "World2D", 0), "set_world_2d", "get_world_2d");