From b0a887ed875168c8378753149c5dbdc3dfcfcb6e Mon Sep 17 00:00:00 2001 From: Shariq Shah Date: Tue, 7 May 2019 12:15:56 +1000 Subject: [PATCH] Fixed ALT key behaviour in transalte tool --- src/game/editor.c | 9 ++++++++- todo.txt | 2 ++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/game/editor.c b/src/game/editor.c index 999253c..dd6ef1c 100755 --- a/src/game/editor.c +++ b/src/game/editor.c @@ -1139,7 +1139,14 @@ void editor_on_key_release(const struct Event* event) if(event->key.key == KEY_X && input_is_key_pressed(KEY_LSHIFT)) editor_axis_set(editor, EDITOR_AXIS_YZ); if(event->key.key == KEY_Y && input_is_key_pressed(KEY_LSHIFT)) editor_axis_set(editor, EDITOR_AXIS_XZ); if(event->key.key == KEY_Z && input_is_key_pressed(KEY_LSHIFT)) editor_axis_set(editor, EDITOR_AXIS_XY); - //if(selected_axis != editor->current_axis) editor_axis_set(editor, selected_axis); + if(event->key.key == KEY_ALT && editor->current_tool == EDITOR_TOOL_TRANSLATE && editor->current_axis == EDITOR_AXIS_Y) + { + if(editor->previous_axis != EDITOR_AXIS_Y) + editor_axis_set(editor, editor->previous_axis); + else + editor_axis_set(editor, EDITOR_AXIS_NONE); + editor->previous_axis = EDITOR_AXIS_NONE; + } /* Grid Scale select */ if(event->key.key == KEY_1) editor->grid_scale = 1.f; diff --git a/todo.txt b/todo.txt index d1ac7d3..bf73bca 100644 --- a/todo.txt +++ b/todo.txt @@ -286,4 +286,6 @@ Done: * Tooltips for current action or hovered entity * Fix broken spot light degree/radian conversions * Fix rotation arc starting and ending degree calculations + * Fix releasing ALT in translate tool not reverting back to previous + axis