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

commitce4e203d83dbab9fd5103defb2a3d14f85140610
parente7a1063857
authorLucas Galante <[email protected]>
date2026-07-05 19:56
Apply optical centering offset of -1.0px to dropdown text and arrow

 src/widget/input/dropdown.rs | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/widget/input/dropdown.rs b/src/widget/input/dropdown.rs
index 92a3de7..26387a6 100644
--- a/src/widget/input/dropdown.rs
+++ b/src/widget/input/dropdown.rs
@@ -541,7 +541,7 @@ impl Element for Dropdown {
         let start_x = x + 8.0;
         let right_limit = x + w - 28.0; // 10px margin before the arrow
         let fade_start_x = (right_limit - 24.0).max(start_x); // Fade out over the last 24px
-        let text_y = self.base.y + top + (self.base.h - top - 12.0) / 2.0;
+        let text_y = self.base.y + top + (self.base.h - top - 12.0) / 2.0 - 1.0;
         let tc = colors::dropdown_text_color();
         let default_color = [
             (colors::linear_to_srgb(tc[0]) * 255.0).round() as u8,
@@ -669,7 +669,7 @@ impl Element for Dropdown {
         labels.push(TextLabel {
             text: "▼".to_string(),
             x: x + w - 18.0,
-            y: self.base.y + top + (self.base.h - top - 10.0) / 2.0,
+            y: self.base.y + top + (self.base.h - top - 10.0) / 2.0 - 1.0,
             font_size: 10.0,
             color: [0x83, 0x83, 0x8a],
         });