Browse Source

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

Fix for 2D viewport not updating in the editor when the camera moves
Rémi Verschelde 2 years ago
parent
commit
156b5ca38f
1 changed files with 5 additions and 2 deletions
  1. 5 2
      scene/2d/camera_2d.cpp

+ 5 - 2
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) {