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

commit04c0484ff80751c2c8711ec8c448fbd1aba7fc0c
parentc4f1ddcf98
authorLucas Galante <[email protected]>
date2026-07-22 10:34
fix: ColorSelector paints a control-height well, not its whole rect

Two things sized the color rows: ParametersBg's 40px color row_height,
and the widget filling its entire assigned rect — so in the pane the
well swallowed the full row and collided with the next row's label
(drawn above its own row, inflating-label convention). The well is now
color_selector_height (22, config-overridable) seated at the rect's
top; the row's bands above and below belong to the labels.

Co-Authored-By: Claude Fable 5 <[email protected]>

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

diff --git a/src/widget/input/color_selector.rs b/src/widget/input/color_selector.rs
index 585a279..3d6c398 100644
--- a/src/widget/input/color_selector.rs
+++ b/src/widget/input/color_selector.rs
@@ -147,6 +147,13 @@ impl Paint for ColorSelector {
     /// The legacy `extra_quads` body against the laid-out rect (field, caret while
     /// editing, and the soft-glow rounded color preview), plus the hex readout label.
     fn paint(&self, rect: Rect, ctx: &mut PaintCtx) {
+        // The well is color_selector_height tall, seated at the rect's TOP —
+        // the label rides above the rect (inflating-label convention) and the
+        // row's bottom band belongs to the NEXT row's label. Hosts that hand
+        // over a whole param row (ParametersBg's 40px color rows) get a
+        // standard control-height well instead of a row-tall one.
+        let well_h = crate::layout::color_selector_height().min(rect.height);
+        let rect = Rect { x: rect.x, y: rect.y, width: rect.width, height: well_h };
         let mut quads: Vec<(f32, f32, f32, f32, [f32; 4])> = Vec::new();
         let visual_h = rect.height;
         let pick_x = rect.x + rect.width * 0.65;