From 14f6f97f9cf55b08211751576090bef28fe2f5d1 Mon Sep 17 00:00:00 2001 From: Dawid Marzec Date: Thu, 21 Sep 2023 13:55:06 +0200 Subject: [PATCH] Don't move not selected cursor item dragging files --- editor/filesystem_dock.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/editor/filesystem_dock.cpp b/editor/filesystem_dock.cpp index 338376c724f5..a7a31bb77c2f 100644 --- a/editor/filesystem_dock.cpp +++ b/editor/filesystem_dock.cpp @@ -1970,15 +1970,15 @@ Vector FileSystemDock::_tree_get_selected(bool remove_self_inclusion) co Vector selected_strings; TreeItem *favorites_item = tree->get_root()->get_first_child(); - TreeItem *active_selected = tree->get_selected(); - if (active_selected && active_selected != favorites_item) { - selected_strings.push_back(active_selected->get_metadata(0)); + TreeItem *cursor_item = tree->get_selected(); + if (cursor_item && cursor_item->is_selected(0) && cursor_item != favorites_item) { + selected_strings.push_back(cursor_item->get_metadata(0)); } TreeItem *selected = tree->get_root(); selected = tree->get_next_selected(selected); while (selected) { - if (selected != active_selected && selected != favorites_item) { + if (selected != cursor_item && selected != favorites_item) { selected_strings.push_back(selected->get_metadata(0)); } selected = tree->get_next_selected(selected);