diff options
Diffstat (limited to 'scene/main/viewport.cpp')
-rw-r--r-- | scene/main/viewport.cpp | 5 |
1 files changed, 5 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); |