From 51a249763e2a28a0c0a0f182fb3752aac9380317 Mon Sep 17 00:00:00 2001 From: iamcheeseman Date: Mon, 18 May 2026 21:06:42 -0400 Subject: add rounding to sliders --- teensy/teensy_ui.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'teensy') diff --git a/teensy/teensy_ui.c b/teensy/teensy_ui.c index e8d71eb..918d203 100644 --- a/teensy/teensy_ui.c +++ b/teensy/teensy_ui.c @@ -1,6 +1,7 @@ #include "teensy_ui.h" #include +#include #include #include "teensy_list.h" @@ -417,6 +418,7 @@ void tyui_slider(float min, float max, float step, float *value) if (hovered && ty_button_down(TY_BTN_DB_LMB)) { float new_val = (float)(mouse_pos.x - bar_rect.x) / bar_rect.w * (max - min) + min; + new_val = round(new_val / step) * step; *value = new_val; } } -- cgit v1.3-2-g0d8e