aboutsummaryrefslogtreecommitdiff
path: root/teensy
diff options
context:
space:
mode:
authoriamcheeseman <[email protected]>2026-05-22 19:24:49 -0400
committeriamcheeseman <[email protected]>2026-05-22 19:24:49 -0400
commita041d7f634e7ced83950a2db1bbafd27ca784927 (patch)
treea5f4c054514838c589c47c2ffde7196f31cbc92d /teensy
parenta2faeeb893dd64cbf59726c25df3ede0be412793 (diff)
fix slider grabber going out of range when value is out of range
Diffstat (limited to 'teensy')
-rw-r--r--teensy/teensy_ui.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/teensy/teensy_ui.c b/teensy/teensy_ui.c
index 8ee35fb..050b1a1 100644
--- a/teensy/teensy_ui.c
+++ b/teensy/teensy_ui.c
@@ -498,6 +498,7 @@ void tyui_slider_ex(
// Grabber
{
+ value = ty_clamp(value, min, max);
float p = (value - min) / max;
int x = (rect.w - grabber_size) * p + rect.x;