diff options
author | Spartan322 <Megacake1234@gmail.com> | 2024-11-27 13:52:25 -0500 |
---|---|---|
committer | Spartan322 <Megacake1234@gmail.com> | 2024-11-27 13:52:25 -0500 |
commit | 721f53fde47c2727d99e3ecccdb789a67df36de0 (patch) | |
tree | 55ec5bfa061a5c27272b831e697b78ed1b756a70 /scene/main | |
parent | b06d20bf39d15ec736d08d4e4fcb32e0c3c1ce1e (diff) | |
parent | f128f383e892865379cb8b14e7bcc9858efe2973 (diff) | |
download | redot-engine-721f53fde47c2727d99e3ecccdb789a67df36de0.tar.gz |
Merge commit godotengine/godot@f128f383e892865379cb8b14e7bcc9858efe2973
Diffstat (limited to 'scene/main')
-rw-r--r-- | scene/main/viewport.cpp | 5 | ||||
-rw-r--r-- | scene/main/viewport.h | 1 |
2 files changed, 6 insertions, 0 deletions
diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp index f66d39dbad..1d5afab526 100644 --- a/scene/main/viewport.cpp +++ b/scene/main/viewport.cpp @@ -1261,6 +1261,10 @@ Ref<World2D> Viewport::get_world_2d() const { return world_2d; } +Transform2D Viewport::get_stretch_transform() const { + return stretch_transform; +} + Transform2D Viewport::get_final_transform() const { ERR_READ_THREAD_GUARD_V(Transform2D()); return stretch_transform * global_canvas_transform; @@ -4643,6 +4647,7 @@ void Viewport::_bind_methods() { ClassDB::bind_method(D_METHOD("set_global_canvas_transform", "xform"), &Viewport::set_global_canvas_transform); ClassDB::bind_method(D_METHOD("get_global_canvas_transform"), &Viewport::get_global_canvas_transform); + ClassDB::bind_method(D_METHOD("get_stretch_transform"), &Viewport::get_stretch_transform); ClassDB::bind_method(D_METHOD("get_final_transform"), &Viewport::get_final_transform); ClassDB::bind_method(D_METHOD("get_screen_transform"), &Viewport::get_screen_transform); diff --git a/scene/main/viewport.h b/scene/main/viewport.h index 31fbefe841..644e55e966 100644 --- a/scene/main/viewport.h +++ b/scene/main/viewport.h @@ -518,6 +518,7 @@ public: void set_global_canvas_transform(const Transform2D &p_transform); Transform2D get_global_canvas_transform() const; + Transform2D get_stretch_transform() const; virtual Transform2D get_final_transform() const; void gui_set_root_order_dirty(); |