Bladeren bron

Allow Center Selection to work without any selection in 2D/3D editors

When there is no selection, the camera will center around the
world origin.

This helps people get back to the world center if they haven't added
any nodes yet.
Hugo Locurcio 4 jaren geleden
bovenliggende
commit
fc055e1993
2 gewijzigde bestanden met toevoegingen van 0 en 7 verwijderingen
  1. 0 3
      editor/plugins/canvas_item_editor_plugin.cpp
  2. 0 4
      editor/plugins/node_3d_editor_plugin.cpp

+ 0 - 3
editor/plugins/canvas_item_editor_plugin.cpp

@@ -5376,9 +5376,6 @@ void CanvasItemEditor::_focus_selection(int p_op) {
 			rect = rect.merge(canvas_item_rect);
 		}
 	};
-	if (count == 0) {
-		return;
-	}
 
 	if (p_op == VIEW_CENTER_TO_SELECTION) {
 		center = rect.position + rect.size / 2;

+ 0 - 4
editor/plugins/node_3d_editor_plugin.cpp

@@ -3545,10 +3545,6 @@ void Node3DEditorViewport::reset() {
 }
 
 void Node3DEditorViewport::focus_selection() {
-	if (!get_selected_count()) {
-		return;
-	}
-
 	Vector3 center;
 	int count = 0;