diff options
Diffstat (limited to 'scene/main/window.cpp')
-rw-r--r-- | scene/main/window.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/scene/main/window.cpp b/scene/main/window.cpp index b6f1d3f54b..33946246b0 100644 --- a/scene/main/window.cpp +++ b/scene/main/window.cpp @@ -1004,7 +1004,7 @@ void Window::_update_viewport_size() { } bool allocate = is_inside_tree() && visible && (window_id != DisplayServer::INVALID_WINDOW_ID || embedder != nullptr); - _set_size(final_size, final_size_override, attach_to_screen_rect, allocate); + _set_size(final_size, final_size_override, allocate); if (window_id != DisplayServer::INVALID_WINDOW_ID) { RenderingServer::get_singleton()->viewport_attach_to_screen(get_viewport_rid(), attach_to_screen_rect, window_id); @@ -2115,13 +2115,17 @@ bool Window::is_auto_translating() const { return auto_translate; } +Transform2D Window::get_final_transform() const { + return window_transform * stretch_transform * global_canvas_transform; +} + Transform2D Window::get_screen_transform() const { Transform2D embedder_transform; if (_get_embedder()) { embedder_transform.translate_local(get_position()); embedder_transform = _get_embedder()->get_screen_transform() * embedder_transform; } - return embedder_transform * Viewport::get_screen_transform(); + return embedder_transform * get_final_transform(); } Transform2D Window::get_popup_base_transform() const { @@ -2130,7 +2134,7 @@ Transform2D Window::get_popup_base_transform() const { } Transform2D popup_base_transform; popup_base_transform.set_origin(get_position()); - popup_base_transform *= Viewport::get_screen_transform(); + popup_base_transform *= get_final_transform(); if (_get_embedder()) { return _get_embedder()->get_popup_base_transform() * popup_base_transform; } |