diff options
author | Krow Savcik <krow@savcik.xyz> | 2024-07-20 01:20:31 +0300 |
---|---|---|
committer | Krow Savcik <krow@savcik.xyz> | 2024-07-20 01:20:31 +0300 |
commit | 1c1c5fa9b1094e96e6eea8abc163949e2277e151 (patch) | |
tree | 9cf6346a595f8dff9fe0c8014a59d2dd560ea50f /src/ui.c | |
parent | 082978b7bf158e4c1eb345db8e41c8df86140ad3 (diff) |
feature: added frame marker
Diffstat (limited to 'src/ui.c')
-rw-r--r-- | src/ui.c | 24 |
1 files changed, 24 insertions, 0 deletions
@@ -298,6 +298,12 @@ ui_mousel_down(int x, int y) y = y - fpan->geom.y - 8; y /= 22; if (y == 0) { + if (x < 162) break; + x = (x - 162) / 22; + if (x >= 0 && x < cur_canvas->frame_arr_cnt) { + cur_canvas->frames[x].state ^= 1; + ui_redraw_panel(UI_PANELTYPE_TIMELINE); + } break; } y -= 1; @@ -312,6 +318,8 @@ ui_mousel_down(int x, int y) canvas_change_layer(cur_canvas, y); ui_redraw_panel(UI_PANELTYPE_TIMELINE); } + + if (x < 162) break; x = (x - 162) / 22; if (x < 0 || x >= cur_canvas->frame_arr_cnt) break; canvas_change_frame(cur_canvas, x); @@ -812,6 +820,22 @@ ui_panel_timeline_redraw(UIPanelTimeline *p) SBDF_SDLPrint(ren, font, text, j, 17); } + for (i = 0; i < cur_canvas->frame_arr_cnt; i++) { + dest.y = 6; + dest.x = 170 + i * 22; + dest.h = 24; + dest.w = 24; + if (cur_canvas->frames[i].state&1^1) continue; + SDL_RenderSetViewport(ren, &dest); + SDL_SetRenderDrawColor(ren, INTTOCOLA(0xff0040ff)); + SDL_RenderDrawLine(ren, 18, 0, 23, 0); + SDL_RenderDrawLine(ren, 18, 1, 23, 1); + SDL_RenderDrawLine(ren, 20, 2, 23, 3); + SDL_RenderDrawLine(ren, 20, 3, 23, 2); + SDL_RenderDrawLine(ren, 22, 4, 23, 4); + SDL_RenderDrawLine(ren, 22, 5, 23, 5); + } + /* Draw cell table */ SDL_SetRenderDrawColor(ren, INTTOCOLA(0x131313ff)); for (i = 0; i < cur_canvas->layer_arr_cnt; i++) { |