From: Randy McShandy Date: Tue, 22 Apr 2025 03:46:55 +0000 (-0500) Subject: Update widgets on palette change via click X-Git-Url: http://git.mcshandy.xyz/gitweb.cgi?a=commitdiff_plain;h=d263c844f7301c217b25931df3e5004138591d22;p=picker Update widgets on palette change via click --- 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;