diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-07-17 19:37:11 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-17 19:37:11 +0200 |
commit | 51a10feb9d1e1e2f5794badfad7a2e9c80a34697 (patch) | |
tree | 39856799e6cd8c19ea815c77412de6df629a8b0f /editor | |
parent | deeec8894ad39d7254cf31f46321fb3cd869461f (diff) | |
parent | ac521788500157dc7f9e33e48fa7e399d6944316 (diff) |
Merge pull request #50509 from Calinou/editor-tweak-select-mode-drag-threshold
Tweak editor select mode drag threshold for better usability
Diffstat (limited to 'editor')
-rw-r--r-- | editor/plugins/canvas_item_editor_plugin.cpp | 2 | ||||
-rw-r--r-- | editor/plugins/node_3d_editor_plugin.cpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp index 240e28a3c5..4af499f10c 100644 --- a/editor/plugins/canvas_item_editor_plugin.cpp +++ b/editor/plugins/canvas_item_editor_plugin.cpp @@ -2324,7 +2324,7 @@ bool CanvasItemEditor::_gui_input_select(const Ref<InputEvent> &p_event) { } if (m.is_valid()) { Point2 click = transform.affine_inverse().xform(m->get_position()); - bool movement_threshold_passed = drag_start_origin.distance_to(click) > 10 * EDSCALE; + bool movement_threshold_passed = drag_start_origin.distance_to(click) > (8 * MAX(1, EDSCALE)) / zoom; if (m.is_valid() && movement_threshold_passed) { List<CanvasItem *> selection2 = _get_edited_canvas_items(); diff --git a/editor/plugins/node_3d_editor_plugin.cpp b/editor/plugins/node_3d_editor_plugin.cpp index 52f1178d06..d5302df5e9 100644 --- a/editor/plugins/node_3d_editor_plugin.cpp +++ b/editor/plugins/node_3d_editor_plugin.cpp @@ -1467,7 +1467,7 @@ void Node3DEditorViewport::_sinput(const Ref<InputEvent> &p_event) { } else if (nav_scheme == NAVIGATION_MODO && m->is_alt_pressed()) { nav_mode = NAVIGATION_ORBIT; } else { - bool movement_threshold_passed = _edit.original_mouse_pos.distance_to(_edit.mouse_pos) > 10 * EDSCALE; + const bool movement_threshold_passed = _edit.original_mouse_pos.distance_to(_edit.mouse_pos) > 8 * EDSCALE; if (clicked.is_valid() && movement_threshold_passed) { if (!clicked_includes_current) { _select_clicked(clicked_wants_append, true); |