diff options
author | Krow Savcik <krow@savcik.xyz> | 2024-02-16 18:32:54 +0200 |
---|---|---|
committer | Krow Savcik <krow@savcik.xyz> | 2024-02-16 18:32:54 +0200 |
commit | ae4f6cc7e9b567bcecc7fb812aa4ab5058aca379 (patch) | |
tree | 97fc380396bd4413c89d3608d45a0bdf25283a4e /src/user.c | |
parent | dc9a97424933e43b69996c0cbab8ecc01cfe72d0 (diff) |
improved: layer interface
New layer is added above the selected one rather than being added on top.
Diffstat (limited to 'src/user.c')
-rw-r--r-- | src/user.c | 13 |
1 files changed, 4 insertions, 9 deletions
@@ -165,12 +165,11 @@ user_tool_change(const Arg *x) } void -user_testing_layer_add(const Arg *x) +user_layer_add(const Arg *x) { -/* TODO: temp function */ if (cur_canvas == NULL) return; - canvas_add_layer(cur_canvas, -1); - cur_canvas->cur_layer = cur_canvas->layer_arr_cnt-1; + canvas_add_layer(cur_canvas, cur_canvas->cur_layer+1); + cur_canvas->cur_layer++; ui_redraw_panel(UI_PANELTYPE_CANVAS); ui_redraw_panel(UI_PANELTYPE_TIMELINE); } @@ -179,11 +178,7 @@ void user_layer_chng(const Arg *x) { if (cur_canvas == NULL) return; - cur_canvas->cur_layer += (unsigned int)cur_canvas->layer_arr_cnt; - cur_canvas->cur_layer += (x->i % (int)cur_canvas->layer_arr_cnt); - cur_canvas->cur_layer %= cur_canvas->layer_arr_cnt; - - ui_redraw_panel(UI_PANELTYPE_CANVAS); + canvas_change_layer(cur_canvas, (cur_canvas->cur_layer + (unsigned int)cur_canvas->layer_arr_cnt + (x->i % (int)cur_canvas->layer_arr_cnt)) % cur_canvas->layer_arr_cnt); ui_redraw_panel(UI_PANELTYPE_TIMELINE); } |