From 5929f64323f00900e9ce8b0ede09e32d8d89fb30 Mon Sep 17 00:00:00 2001
From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>
Date: Mon, 7 Apr 2025 18:30:42 +1000
Subject: slider: clamp value between 0 and 1

---
 src/widgets/slider.tsx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'src/widgets/slider.tsx')

diff --git a/src/widgets/slider.tsx b/src/widgets/slider.tsx
index c047d5f..0a66609 100644
--- a/src/widgets/slider.tsx
+++ b/src/widgets/slider.tsx
@@ -13,7 +13,7 @@ export default ({
         hexpand
         valign={Gtk.Align.CENTER}
         className="slider"
-        css={bind(value).as(v => `font-size: ${v}px;`)}
+        css={bind(value).as(v => `font-size: ${Math.min(1, Math.max(0, v))}px;`)}
         setup={self => {
             const halfPi = Math.PI / 2;
 
-- 
cgit v1.2.3-freya

