diff --git a/crates/ui/src/slider.rs b/crates/ui/src/slider.rs index f2b47357..ec6c83fb 100644 --- a/crates/ui/src/slider.rs +++ b/crates/ui/src/slider.rs @@ -107,6 +107,7 @@ impl Slider { max - (max - min) * relative } }; + let value = (value / step).round() * step; self.value = value.clamp(self.min, self.max); @@ -137,7 +138,7 @@ impl Slider { }, )) .absolute() - .top(px(-4.)) + .top(px(-5.)) .left(relative(self.relative_value())) .ml(-px(8.)) .size_4() @@ -161,12 +162,13 @@ impl Render for Slider { div() .id("slider") .on_mouse_down(MouseButton::Left, cx.listener(Self::on_mouse_down)) - .py_1() + .h_5() .child( div() .id("slider-bar") .relative() .w_full() + .my_1p5() .h_1p5() .bg(cx.theme().slider_bar.opacity(0.2)) .active(|this| this.bg(cx.theme().slider_bar.opacity(0.4)))