Merge pull request #69645 from radenling/backport-fix-viewport-update-in-editor

[3.x] Fix for 2D viewport not updating in the editor when the camera moves
This commit is contained in:
Rémi Verschelde 2023-04-11 10:53:20 +02:00
commit 564622af51
No known key found for this signature in database
GPG Key ID: C3336907360768E1

View File

@ -41,9 +41,12 @@ void Camera2D::_update_scroll() {
} }
if (Engine::get_singleton()->is_editor_hint()) { if (Engine::get_singleton()->is_editor_hint()) {
update(); //will just be drawn update();
// Only set viewport transform when not bound to the main viewport.
if (get_viewport() == get_tree()->get_edited_scene_root()->get_viewport()) {
return; return;
} }
}
if (!viewport) { if (!viewport) {
return; return;