summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2017-11-08 10:08:39 +0100
committerGitHub <noreply@github.com>2017-11-08 10:08:39 +0100
commit1821915eb5044c2bb74c6f733c82c43cfbc40fc6 (patch)
tree655e85efd82afebb80a30d86605bf28ca653f544
parentec77cccb1dab35a6f655cf5946a48cbfc1f598cf (diff)
parentc755b684c9bcaac1e74f407feaf311b5457ddc64 (diff)
Merge pull request #12735 from mhilbrunner/delete-clearselect
Editor: Update 2D viewport and inspector selection on delete.
-rw-r--r--editor/scene_tree_dock.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/editor/scene_tree_dock.cpp b/editor/scene_tree_dock.cpp
index 7438c7671e..58f70ce11e 100644
--- a/editor/scene_tree_dock.cpp
+++ b/editor/scene_tree_dock.cpp
@@ -533,10 +533,6 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) {
if (p_confirm_override) {
_delete_confirm();
- // hack, force 2d editor viewport to refresh after deletion
- if (CanvasItemEditor *editor = CanvasItemEditor::get_singleton())
- editor->get_viewport_control()->update();
-
} else {
delete_dialog->set_text(TTR("Delete Node(s)?"));
delete_dialog->popup_centered_minsize();
@@ -1345,6 +1341,12 @@ void SceneTreeDock::_delete_confirm() {
}
}
editor_data->get_undo_redo().commit_action();
+
+ // hack, force 2d editor viewport to refresh after deletion
+ if (CanvasItemEditor *editor = CanvasItemEditor::get_singleton())
+ editor->get_viewport_control()->update();
+
+ editor->push_item(NULL);
}
void SceneTreeDock::_selection_changed() {