From 3641a2f448214527a43a86ad1653a224935be85d Mon Sep 17 00:00:00 2001 From: Shariq Shah Date: Thu, 2 May 2019 15:10:26 +1000 Subject: [PATCH] Implemented reverting back to previous axis when rotate tool is selected and not moving the camera anymore --- src/game/editor.c | 4 ++++ todo.txt | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/game/editor.c b/src/game/editor.c index 57ec381..8fd2c72 100755 --- a/src/game/editor.c +++ b/src/game/editor.c @@ -677,6 +677,9 @@ void editor_on_mousebutton_release(const struct Event* event) editor->draw_entity_wireframe = false; } } + + if(editor->selected_entity && editor->current_tool == EDITOR_TOOL_ROTATE && editor->previous_axis != EDITOR_AXIS_NONE) + editor_axis_set(editor, editor->previous_axis); } void editor_on_mousebutton_press(const struct Event* event) @@ -957,6 +960,7 @@ void editor_tool_set(struct Editor* editor, int tool) editor->draw_entity_wireframe = true; else editor->draw_entity_wireframe = false; + editor->previous_axis = editor->current_axis; editor_tool_reset(editor); } diff --git a/todo.txt b/todo.txt index 490293b..3b12eed 100644 --- a/todo.txt +++ b/todo.txt @@ -11,6 +11,8 @@ Todo: - Color palette, picker and dropper - Key binding and function to snap editor camera to selected entity location + - Implement resetting complete transform or just rotation, translation + or scale for selected entity - Key binding and function to orient entity to camera orientation - Mouse warp to opposite side of the window when it reaches bounds - Add other axis combinations like YZ and XY to transform tool @@ -272,4 +274,6 @@ Done: * Removed all usages of tool_mesh_position * Renamed editor modes to editor tools to make the code more consistent + * Implemented reverting back to previously selected axis when not + moving the camera any more and rotate tool is selected.