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

commit86e84473a70c59e08961beb159e291abd90d0405
parent6c5f1b7e11
authorLucas Galante <[email protected]>
date2026-07-23 14:58
fix: labeled inset's top slope stays inside the inset — it washed upward

The slope profile straddles its boundary by ±roll/2, and the top wall used
roll = 2*(strip+g) with its boundary at the inset's top edge — so the
outward half climbed strip+g past the inset into whatever sat above (a
soft shadow band across the bottom of the ramp's graph). The boundary now
sits at the midpoint of the run the slope should cover, with roll =
strip+g: the slope spans exactly from the inset's top edge down to the
trigger's top, nothing above.

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

 src/widget/input/dropdown.rs | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/src/widget/input/dropdown.rs b/src/widget/input/dropdown.rs
index a940ae9..38b0a9f 100644
--- a/src/widget/input/dropdown.rs
+++ b/src/widget/input/dropdown.rs
@@ -343,7 +343,20 @@ impl Dropdown {
                 };
                 let orad = (r4[0] + g, r4[1] + g, r4[2] + g, r4[3] + g);
                 ctx.recess_edges(outer, orad, depth, (false, true, true, true));
-                ctx.recess_edges(outer, orad, 2.0 * (strip + g), (true, false, false, false));
+                // The slope profile straddles its boundary by ±roll/2, so the
+                // top wall's boundary sits at the MIDPOINT of the run it
+                // should cover — from the inset's top edge down to the
+                // trigger's top — or the outward half would climb past the
+                // inset into whatever sits above (it washed into the ramp's
+                // graph; found the hard way).
+                let span = strip + g;
+                let top = Rect {
+                    x: outer.x,
+                    y: outer.y + span * 0.5,
+                    width: outer.width,
+                    height: outer.height - span * 0.5,
+                };
+                ctx.recess_edges(top, orad, span, (true, false, false, false));
                 let rect = Rect { x, y, width: w, height: visual_h };
                 let rrad = (r4[0], r4[1], r4[2], r4[3]);
                 if face[3] > 0.001 {