From d263c844f7301c217b25931df3e5004138591d22 Mon Sep 17 00:00:00 2001 From: Randy McShandy Date: Mon, 21 Apr 2025 22:46:55 -0500 Subject: [PATCH] Update widgets on palette change via click --- source/rendering.c | 2 +- source/structs.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/source/rendering.c b/source/rendering.c index f7353cb..c37b11e 100644 --- a/source/rendering.c +++ b/source/rendering.c @@ -183,6 +183,7 @@ int32_t render_palette(Runtime_Info* runtime, SDL_FRect* container) if (mouse_click_in_container(runtime, &item, M_LEFT)) { runtime->active_palette = p; + runtime->active_hsl = runtime->layout.palette_color[p]; } if (mouse_click_in_container(runtime, &item, M_RIGHT)) { @@ -503,7 +504,6 @@ int32_t check_inputs(Runtime_Info* runtime) { runtime->active_palette = new_palette; runtime->active_hsl = runtime->layout.palette_color[new_palette]; - runtime->active_rgb = hsl_to_rgb(runtime->active_hsl); } } break; diff --git a/source/structs.h b/source/structs.h index affbaa3..c997e2e 100644 --- a/source/structs.h +++ b/source/structs.h @@ -78,6 +78,7 @@ typedef struct typedef enum { M_LEFT = SDL_BUTTON_LMASK, + M_MIDDLE = SDL_BUTTON_MMASK, M_RIGHT = SDL_BUTTON_RMASK, M_COUNT } mouse_button; -- 2.49.0