summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2022-02-09 14:16:00 +0100
committerGitHub <noreply@github.com>2022-02-09 14:16:00 +0100
commit2cdbb7c9b858b412df4c1eb50eba921985054f69 (patch)
tree350fe29a8baac946cbe949c9e93081986b7cd719 /editor
parent77c2bfb6366add6aa0b4d1945c554b0a24584ab3 (diff)
parentc283a0ece7f8c508aa28d787fc103e6b6cdaffb6 (diff)
Merge pull request #57847 from mbrlabs/region-select
Diffstat (limited to 'editor')
-rw-r--r--editor/plugins/node_3d_editor_plugin.cpp10
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();