You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-08 12:40:44 +00:00
Add threshold to dragging nodes with select to prevent accidental drags
This commit is contained in:
@@ -1244,6 +1244,7 @@ void Node3DEditorViewport::_sinput(const Ref<InputEvent> &p_event) {
|
||||
}
|
||||
|
||||
_edit.mouse_pos = b->get_position();
|
||||
_edit.original_mouse_pos = b->get_position();
|
||||
_edit.snap = spatial_editor->is_snap_enabled();
|
||||
_edit.mode = TRANSFORM_NONE;
|
||||
|
||||
@@ -1450,7 +1451,8 @@ void Node3DEditorViewport::_sinput(const Ref<InputEvent> &p_event) {
|
||||
} else if (nav_scheme == NAVIGATION_MODO && m->is_alt_pressed()) {
|
||||
nav_mode = NAVIGATION_ORBIT;
|
||||
} else {
|
||||
if (clicked.is_valid()) {
|
||||
bool movement_threshold_passed = _edit.original_mouse_pos.distance_to(_edit.mouse_pos) > 10 * EDSCALE;
|
||||
if (clicked.is_valid() && movement_threshold_passed) {
|
||||
if (!clicked_includes_current) {
|
||||
_select_clicked(clicked_wants_append, true);
|
||||
// Processing was deferred.
|
||||
|
||||
Reference in New Issue
Block a user