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

commit0681a4b79657e77c15eaa1ee002089faf5f4efce
parent9019d1f93c
authorLucas Galante <[email protected]>
date2026-07-03 18:19
fix: draw rounded_quads before quads to prevent background overlaying foreground elements

 src/backend/window_runner.rs | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/backend/window_runner.rs b/src/backend/window_runner.rs
index 56604e2..1177784 100644
--- a/src/backend/window_runner.rs
+++ b/src/backend/window_runner.rs
@@ -1541,9 +1541,6 @@ impl<A: Application> EngineState<A> {
         
         // 1. Build and upload vertex buffer
         let mut verts = Vec::new();
-        for &(qx, qy, qw, qh, qc) in &quads {
-            verts.extend(quad_vertices(qx, qy, qw, qh, logical_w, logical_h, qc));
-        }
         for &(qx, qy, qw, qh, qr, qc, qcorners) in &rounded_quads {
             if qr > 0.1 {
                 let radii = crate::widget::CornerRadii::new(
@@ -1557,6 +1554,9 @@ impl<A: Application> EngineState<A> {
                 verts.extend(quad_vertices(qx, qy, qw, qh, logical_w, logical_h, qc));
             }
         }
+        for &(qx, qy, qw, qh, qc) in &quads {
+            verts.extend(quad_vertices(qx, qy, qw, qh, logical_w, logical_h, qc));
+        }
         for &(vx1, vy1, vx2, vy2, vthickness, vcolor, vcap) in &vectors {
             verts.extend(vector_vertices(vx1, vy1, vx2, vy2, vthickness, logical_w, logical_h, vcolor, vcap));
         }