From ae4f6cc7e9b567bcecc7fb812aa4ab5058aca379 Mon Sep 17 00:00:00 2001 From: Krow Savcik Date: Fri, 16 Feb 2024 18:32:54 +0200 Subject: improved: layer interface New layer is added above the selected one rather than being added on top. --- src/user.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'src/user.c') diff --git a/src/user.c b/src/user.c index 54ae60d..9d1b437 100644 --- a/src/user.c +++ b/src/user.c @@ -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); } -- cgit v1.2.3