summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-04-16 12:47:47 +0200
committerGitHub <noreply@github.com>2021-04-16 12:47:47 +0200
commit2e87857d758efb69989bc8c1cc5693f86df55d87 (patch)
tree3440795fde0c4e2d6ec8e6743d5cbfbe755036f3 /editor
parent0e72d3d8f9a11e7f3a143b20d5439bb493903351 (diff)
parentfc055e199328b9ff55535862af2e5fab96be82b5 (diff)
Merge pull request #47629 from Calinou/editor-allow-center-selection-without-selection
Allow Center Selection to work without any selection in 2D/3D editors
Diffstat (limited to 'editor')
-rw-r--r--editor/plugins/canvas_item_editor_plugin.cpp3
-rw-r--r--editor/plugins/node_3d_editor_plugin.cpp4
2 files changed, 0 insertions, 7 deletions
diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp
index f1c9cb120d..fc3e15aa52 100644
--- a/editor/plugins/canvas_item_editor_plugin.cpp
+++ b/editor/plugins/canvas_item_editor_plugin.cpp
@@ -5385,9 +5385,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;
diff --git a/editor/plugins/node_3d_editor_plugin.cpp b/editor/plugins/node_3d_editor_plugin.cpp
index 3df092bc13..13c7814dac 100644
--- a/editor/plugins/node_3d_editor_plugin.cpp
+++ b/editor/plugins/node_3d_editor_plugin.cpp
@@ -3560,10 +3560,6 @@ void Node3DEditorViewport::reset() {
}
void Node3DEditorViewport::focus_selection() {
- if (!get_selected_count()) {
- return;
- }
-
Vector3 center;
int count = 0;