From 6718a9e4cfeffd43b1b9493aa0d3cf9537ab395c Mon Sep 17 00:00:00 2001 From: Robert Yevdokimov Date: Sun, 4 Feb 2024 10:17:09 -0500 Subject: [PATCH] Fix bug that translates node during region select over geometry by always defaulting to region select --- editor/plugins/node_3d_editor_plugin.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/editor/plugins/node_3d_editor_plugin.cpp b/editor/plugins/node_3d_editor_plugin.cpp index 5e70354d22d..cd6bbbf88e0 100644 --- a/editor/plugins/node_3d_editor_plugin.cpp +++ b/editor/plugins/node_3d_editor_plugin.cpp @@ -1985,9 +1985,8 @@ void Node3DEditorViewport::_sinput(const Ref &p_event) { } else { const bool movement_threshold_passed = _edit.original_mouse_pos.distance_to(_edit.mouse_pos) > 8 * EDSCALE; - // enable region-select if nothing has been selected yet or multi-select (shift key) is active - if (selection_in_progress && movement_threshold_passed) { - if (get_selected_count() == 0 || clicked_wants_append) { + if (selection_in_progress && movement_threshold_passed && clicked.is_valid()) { + if (clicked_wants_append || !editor_selection->is_selected(Object::cast_to(ObjectDB::get_instance(clicked)))) { cursor.region_select = true; cursor.region_begin = _edit.original_mouse_pos; clicked = ObjectID();