diff options
author | Marcus Brummer <mbrlabs7@gmail.com> | 2022-02-09 10:32:03 +0100 |
---|---|---|
committer | Marcus Brummer <mbrlabs7@gmail.com> | 2022-02-09 12:22:03 +0100 |
commit | c283a0ece7f8c508aa28d787fc103e6b6cdaffb6 (patch) | |
tree | 00d95eb8c8008081cad927669adee3aceaeec7f9 /editor | |
parent | 79077e6c10db9e8e53a8134f72e326f3ffb9c51c (diff) |
Improved region-select in the 3D editor viewport
Diffstat (limited to 'editor')
-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(); |