diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2024-09-05 17:44:15 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2024-09-05 17:44:15 +0200 |
commit | f5aac22b107ba99bca4ea068e64cd037a7a363c0 (patch) | |
tree | eb93b0fedc206a6fef7d3e1ea44625e3962366d8 /editor | |
parent | 4629f7d040cf98baf2ea08126fb110691b30b36e (diff) | |
parent | 060a1a089984460ed61adae5e0b2cf8c3b0c5541 (diff) | |
download | redot-engine-f5aac22b107ba99bca4ea068e64cd037a7a363c0.tar.gz |
Merge pull request #96530 from ev13bird/issue-96527
Fix instant transformations not being committed when used in succession
Diffstat (limited to 'editor')
-rw-r--r-- | editor/plugins/node_3d_editor_plugin.cpp | 31 |
1 files changed, 23 insertions, 8 deletions
diff --git a/editor/plugins/node_3d_editor_plugin.cpp b/editor/plugins/node_3d_editor_plugin.cpp index 8679dc25a4..b85b520893 100644 --- a/editor/plugins/node_3d_editor_plugin.cpp +++ b/editor/plugins/node_3d_editor_plugin.cpp @@ -1975,7 +1975,7 @@ void Node3DEditorViewport::_sinput(const Ref<InputEvent> &p_event) { } } - if (_edit.mode != TRANSFORM_NONE) { + if (!_edit.instant && _edit.mode != TRANSFORM_NONE) { Node3D *selected = spatial_editor->get_single_selected_node(); Node3DEditorSelectedItem *se = selected ? editor_selection->get_node_editor_data<Node3DEditorSelectedItem>(selected) : nullptr; @@ -2399,15 +2399,30 @@ void Node3DEditorViewport::_sinput(const Ref<InputEvent> &p_event) { if (ED_IS_SHORTCUT("spatial_editor/cancel_transform", p_event) && _edit.mode != TRANSFORM_NONE) { cancel_transform(); } - if (!is_freelook_active()) { - if (ED_IS_SHORTCUT("spatial_editor/instant_translate", p_event)) { - begin_transform(TRANSFORM_TRANSLATE, true); + if (!is_freelook_active() && !k->is_echo()) { + if (ED_IS_SHORTCUT("spatial_editor/instant_translate", p_event) && _edit.mode != TRANSFORM_TRANSLATE) { + if (_edit.mode == TRANSFORM_NONE) { + begin_transform(TRANSFORM_TRANSLATE, true); + } else if (_edit.instant) { + commit_transform(); + begin_transform(TRANSFORM_TRANSLATE, true); + } } - if (ED_IS_SHORTCUT("spatial_editor/instant_rotate", p_event)) { - begin_transform(TRANSFORM_ROTATE, true); + if (ED_IS_SHORTCUT("spatial_editor/instant_rotate", p_event) && _edit.mode != TRANSFORM_ROTATE) { + if (_edit.mode == TRANSFORM_NONE) { + begin_transform(TRANSFORM_ROTATE, true); + } else if (_edit.instant) { + commit_transform(); + begin_transform(TRANSFORM_ROTATE, true); + } } - if (ED_IS_SHORTCUT("spatial_editor/instant_scale", p_event)) { - begin_transform(TRANSFORM_SCALE, true); + if (ED_IS_SHORTCUT("spatial_editor/instant_scale", p_event) && _edit.mode != TRANSFORM_SCALE) { + if (_edit.mode == TRANSFORM_NONE) { + begin_transform(TRANSFORM_SCALE, true); + } else if (_edit.instant) { + commit_transform(); + begin_transform(TRANSFORM_SCALE, true); + } } } |