diff options
| author | Nathan Reiner <nathan@nathanreiner.xyz> | 2023-04-20 21:55:47 +0200 |
|---|---|---|
| committer | Nathan Reiner <nathan@nathanreiner.xyz> | 2023-04-20 21:55:47 +0200 |
| commit | a46daccc110b6a43bf1dba928d7f1f1e72a14d81 (patch) | |
| tree | ef66aacc32657452b8b435a2f5e732b49b08f41f /swt.c | |
| parent | a4a86549a939dee9da41f28efe7435ba4884f1a6 (diff) | |
fix missing font crash and use color index as rgb if not found
Diffstat (limited to 'swt.c')
| -rw-r--r-- | swt.c | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -72,7 +72,7 @@ static int execshortcut(); static char *kmap(); static void buffer_release(void *data, struct wl_buffer *buffer); static void draw_frame(); -static uint32_t get_color(int i); +static uint32_t get_color(uint32_t i); static void draw_glyph(Glyph g, int x, int y); static void commit_surface(); static void surface_configure(void *data, struct xdg_surface *surface, uint32_t serial); @@ -216,10 +216,11 @@ paste() uint32_t -get_color(int i) +get_color(uint32_t i) { - if (!BETWEEN(i, 0, sizeof(colors) / sizeof(uint32_t))) - return colors[defaultbg]; + if (!BETWEEN(i, 0, sizeof(colors) / sizeof(uint32_t))) { + return i; + } return colors[i]; } |