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

commitd1389a3fff14dc9a19b0497923f3c3fa16c6a0c5
parenta004ee71f2
authorLucas Galante <[email protected]>
date2026-07-04 20:17
Implement set_rect for Dropdown to account for label offset

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

diff --git a/src/widget/input/dropdown.rs b/src/widget/input/dropdown.rs
index 12a9937..c2367b8 100644
--- a/src/widget/input/dropdown.rs
+++ b/src/widget/input/dropdown.rs
@@ -176,6 +176,13 @@ impl Default for Dropdown {
 impl Element for Dropdown {
     crate::impl_widget_base!(Dropdown);
 
+    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 get_value_string(&self) -> Option<String> {
         self.options.get(self.selected).cloned()
     }