diff options
| author | Sam Anthony <sam@samanthony.xyz> | 2025-04-30 11:30:48 -0400 |
|---|---|---|
| committer | Sam Anthony <sam@samanthony.xyz> | 2025-04-30 11:30:48 -0400 |
| commit | 550dee49514fe3528c43541f062c1ae5590313ae (patch) | |
| tree | 5378c2940fa8352d5e365ec5309a8de8635ed9b4 | |
| parent | eb38a10f13e0c778afe72171a6792e615d01087e (diff) | |
| download | volute-550dee49514fe3528c43541f062c1ae5590313ae.zip | |
clear canvas
| -rw-r--r-- | renderer.c | 10 | ||||
| -rw-r--r-- | renderer.h | 1 |
2 files changed, 11 insertions, 0 deletions
@@ -481,6 +481,16 @@ r_canvas_draw_circle(int id, int x, int y, int r, mu_Color color) { return 0; } +void +r_clear_canvas(int id) { + Canvas canvas; + + expect(id >= 0 && id < canvas_list.idx); + + canvas = canvas_list.items[id]; + clear_surface(canvas.fg); +} + /* Render a canvas to its underlying icon texture. Returns the id of the icon, or -1 on error. */ int r_render_canvas(int id) { @@ -9,4 +9,5 @@ void r_get_icon_size(int id, int *w, int *h); int r_add_canvas(const char *bg_img_path); void r_remove_canvas(int id); int r_canvas_draw_circle(int id, int x, int y, int r, mu_Color color); +void r_clear_canvas(int id); int r_render_canvas(int id); |