git.lucas.co / cce-ui
GPU-accelerated UI toolkit (Vulkan)
git clone https://git.lucas.co/cce-ui.git

commit89933f1d4001315e1e5ee1a204246d908c4305b3
parent8cd3a4a90c
authorLucas Galante <[email protected]>
date2026-07-04 19:31
Implement set_rect override for Slider to isolate label height

 src/widget/input/slider.rs | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/widget/input/slider.rs b/src/widget/input/slider.rs
index a437d48..371b121 100644
--- a/src/widget/input/slider.rs
+++ b/src/widget/input/slider.rs
@@ -113,6 +113,13 @@ impl Slider {
 impl Element for Slider {
     crate::impl_widget_base!(Slider);
 
+    fn set_rect(&mut self, x: f32, y: f32, w: f32, h: f32) {
+        self.base.x = x;
+        self.base.y = y;
+        self.base.w = w;
+        self.base.h = h + self.base.label_offset();
+    }
+
     fn widget_font(&self) -> Option<String> {
         Some(crate::layout::slider_font())
     }