diff options
author | Krow Savcik <krow@savcik.xyz> | 2024-02-06 22:56:21 +0200 |
---|---|---|
committer | Krow Savcik <krow@savcik.xyz> | 2024-02-06 22:56:21 +0200 |
commit | c918280fb5de6e6256cfd9a438b3578c04e3afc2 (patch) | |
tree | ba72e1464c487b61d4376647769c93cdbccf7a21 /src/user.c | |
parent | 009a890482edfb2247da1d69b86f4d193699e3cb (diff) |
feautre: added undo/redo buttons
The change history is kept in a ring buffer of definite size 2000.
Diffstat (limited to 'src/user.c')
-rw-r--r-- | src/user.c | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -12,6 +12,7 @@ #include "cdraw.h" #include "types.h" #include "tools.h" +#include "action.h" #include "canvas.h" #include "palette.h" @@ -242,3 +243,19 @@ choose_file_path(const char *prompt, char *input) if (ft != stdin) pclose(ft); } + +void +user_canvas_undo(const Arg *x) +{ + if (cur_canvas == NULL) return; + action_undo(cur_canvas); + ui_redraw_panel(UI_PANELTYPE_CANVAS); +} + +void +user_canvas_redo(const Arg *x) +{ + if (cur_canvas == NULL) return; + action_redo(cur_canvas); + ui_redraw_panel(UI_PANELTYPE_CANVAS); +} |