diff options
author | Richard Adenling <dreeze@gmail.com> | 2022-12-06 09:56:47 +0100 |
---|---|---|
committer | Richard Adenling <dreeze@gmail.com> | 2022-12-06 11:34:32 +0100 |
commit | a3d8a78f1b7bfe75f12b7d5a511e991e24b8ed79 (patch) | |
tree | a8152d9861a42cd711b82fe4077c6018d0d00d43 /scene/2d | |
parent | f3e6750a7e4702918e05f42b1376e30e652f2f90 (diff) |
Fix for 2D viewport not updating in the editor when the camera moves
This fixes a problem with 2D viewports not taking the camera position
into consideration when previewed in the editor.
Fixes #40441
Diffstat (limited to 'scene/2d')
-rw-r--r-- | scene/2d/camera_2d.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/scene/2d/camera_2d.cpp b/scene/2d/camera_2d.cpp index 4b31bbddac..229625ad6d 100644 --- a/scene/2d/camera_2d.cpp +++ b/scene/2d/camera_2d.cpp @@ -39,8 +39,11 @@ void Camera2D::_update_scroll() { } if (Engine::get_singleton()->is_editor_hint()) { - queue_redraw(); //will just be drawn - return; + queue_redraw(); + // Only set viewport transform when not bound to the main viewport. + if (get_viewport() == get_tree()->get_edited_scene_root()->get_viewport()) { + return; + } } if (!viewport) { |