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

commitb24db72b5cfb5f9b6a4436222bd380395cd7ec4b
parent9a025b0c9e
authorLucas Galante <[email protected]>
date2026-07-04 21:28
Exclude rounded child background from flat quads in ControlPanel::extra_quads

 src/widget/container/control_panel.rs | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/widget/container/control_panel.rs b/src/widget/container/control_panel.rs
index cbce9d9..af0f51c 100644
--- a/src/widget/container/control_panel.rs
+++ b/src/widget/container/control_panel.rs
@@ -355,7 +355,15 @@ impl Element for ControlPanel {
 
         unsafe {
             for child_ptr in &self.children {
-                for (qx, qy, qw, qh, qc) in (**child_ptr).all_quads(&ctx_dummy) {
+                let child = &**child_ptr;
+                let (cx, cy, cw, ch) = child.rect();
+                let has_rounded = child.rounded_corners() != (false, false, false, false);
+                let has_bg = child.color()[3].abs() > 0.001;
+
+                for (qx, qy, qw, qh, qc) in child.all_quads(&ctx_dummy) {
+                    if has_rounded && has_bg && (qx - cx).abs() < 0.1 && (qy - cy).abs() < 0.1 && (qw - cw).abs() < 0.1 && (qh - ch).abs() < 0.1 {
+                        continue;
+                    }
                     let qy_shifted = qy - scroll_y;
                     let qy_top = qy_shifted;
                     let qy_bottom = qy_shifted + qh;