diff options
Diffstat (limited to 'editor/plugins')
-rw-r--r-- | editor/plugins/node_3d_editor_plugin.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/editor/plugins/node_3d_editor_plugin.cpp b/editor/plugins/node_3d_editor_plugin.cpp index 2e8ae1a286..e35af6dd64 100644 --- a/editor/plugins/node_3d_editor_plugin.cpp +++ b/editor/plugins/node_3d_editor_plugin.cpp @@ -1468,6 +1468,8 @@ void Node3DEditorViewport::_sinput(const Ref<InputEvent> &p_event) { } break; case MouseButton::LEFT: { if (b->is_pressed()) { + clicked_wants_append = b->is_shift_pressed(); + if (_edit.mode != TRANSFORM_NONE && _edit.instant) { commit_transform(); break; // just commit the edit, stop processing the event so we don't deselect the object @@ -1597,8 +1599,6 @@ void Node3DEditorViewport::_sinput(const Ref<InputEvent> &p_event) { //clicking is always deferred to either move or release - clicked_wants_append = b->is_shift_pressed(); - if (clicked.is_null()) { //default to regionselect cursor.region_select = true; @@ -1727,6 +1727,12 @@ void Node3DEditorViewport::_sinput(const Ref<InputEvent> &p_event) { _edit.mode = TRANSFORM_TRANSLATE; } + // enable region-select if nothing has been selected yet or multi-select (shift key) is active + if (movement_threshold_passed && (get_selected_count() == 0 || clicked_wants_append)) { + cursor.region_select = true; + cursor.region_begin = _edit.original_mouse_pos; + } + if (cursor.region_select) { cursor.region_end = m->get_position(); surface->update(); |