Browse Source

Scroll scene tree when moving item with keys

AeioMuch 2 tháng trước cách đây
mục cha
commit
5a38042b2d
1 tập tin đã thay đổi với 3 bổ sung0 xóa
  1. 3 0
      editor/docks/scene_tree_dock.cpp

+ 3 - 0
editor/docks/scene_tree_dock.cpp

@@ -872,6 +872,9 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) {
 
 			undo_redo->commit_action();
 
+			NodePath np = selection.front()->get()->get_path();
+			TreeItem *item = scene_tree->get_scene_tree()->get_item_with_metadata(np);
+			callable_mp(scene_tree->get_scene_tree(), &Tree::scroll_to_item).call_deferred(item, false);
 		} break;
 		case TOOL_DUPLICATE: {
 			if (!profile_allow_editing) {