mirror of https://github.com/godotengine/godot
Fix instant transformations not being committed when used in succession
Also:
- Fix holding down keys repeatedly committing instant transformations, and disallow starting instant during non-instant
- Fix echoed inputs starting new instant transformations after clicking to confirm, and disallow left mouse release committing instant transformations
(cherry picked from commit 060a1a0899)
This commit is contained in:
parent
64cbde426f
commit
cbcc5f8d19
|
|
@ -1951,7 +1951,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;
|
||||
|
||||
|
|
@ -2394,15 +2394,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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue