From c6a96fc3607c050fd064946fe3a6ac23a66dbd76 Mon Sep 17 00:00:00 2001 From: Chaosus Date: Wed, 21 Feb 2018 17:14:26 +0300 Subject: Enable snapping when control key pressed (cherry picked from commit 24c170555d57ccbbb270f02d0b5d3e98f99b8729) --- editor/plugins/spatial_editor_plugin.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'editor/plugins/spatial_editor_plugin.cpp') diff --git a/editor/plugins/spatial_editor_plugin.cpp b/editor/plugins/spatial_editor_plugin.cpp index 63762651d..fa7a2269d 100644 --- a/editor/plugins/spatial_editor_plugin.cpp +++ b/editor/plugins/spatial_editor_plugin.cpp @@ -4674,6 +4674,8 @@ void SpatialEditor::_unhandled_key_input(Ref p_event) { if (!is_visible_in_tree() || get_viewport()->gui_has_modal_stack()) return; + snap_key_enabled = Input::get_singleton()->is_key_pressed(KEY_CONTROL); + Ref k = p_event; if (k.is_valid()) { @@ -4941,6 +4943,7 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) { editor_selection->add_editor_plugin(this); snap_enabled = false; + snap_key_enabled = false; tool_mode = TOOL_MODE_SELECT; hbc_menu = memnew(HBoxContainer); -- cgit v1.2.3-70-g09d2