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

commitd98544b64d24f26d1156b2fe61395559aaabbd4c
parent322f4e7d57
authorLucas Galante <[email protected]>
date2026-06-16 18:42
Fix disappearing color previews: increase extra_corners check tolerance to 1.5

 src/backend/window_runner.rs | 16 ++++++++--------
 src/layout.rs                |  8 ++++----
 src/main.rs                  |  8 ++++----
 3 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/src/backend/window_runner.rs b/src/backend/window_runner.rs
index f691d3f..b8b0472 100644
--- a/src/backend/window_runner.rs
+++ b/src/backend/window_runner.rs
@@ -615,10 +615,10 @@ pub fn push_extra_quad_vertices(
     wy += top_room;
     wh -= top_room;
     let extra_corners = (
-        corners.0 && qx <= wx + 0.1 && qy <= wy + 0.1,
-        corners.1 && qx + qw >= wx + ww - 0.1 && qy <= wy + 0.1,
-        corners.2 && qx + qw >= wx + ww - 0.1 && qy + qh >= wy + wh - 0.1,
-        corners.3 && qx <= wx + 0.1 && qy + qh >= wy + wh - 0.1,
+        corners.0 && qx <= wx + 1.5 && qy <= wy + 1.5,
+        corners.1 && qx + qw >= wx + ww - 1.5 && qy <= wy + 1.5,
+        corners.2 && qx + qw >= wx + ww - 1.5 && qy + qh >= wy + wh - 1.5,
+        corners.3 && qx <= wx + 1.5 && qy + qh >= wy + wh - 1.5,
     );
 
     push_rounded_rect_vertices_corners(qx, qy, qw, qh, target_w.corner_radius(), sw, sh, qc, clip_circle, extra_corners, None, out);
@@ -666,10 +666,10 @@ pub fn push_extra_quad_vertices_clipped(
     wy += top_room;
     wh -= top_room;
     let extra_corners = (
-        corners.0 && qx <= wx + 0.1 && qy <= wy + 0.1,
-        corners.1 && qx + qw >= wx + ww - 0.1 && qy <= wy + 0.1,
-        corners.2 && qx + qw >= wx + ww - 0.1 && qy + qh >= wy + wh - 0.1,
-        corners.3 && qx <= wx + 0.1 && qy + qh >= wy + wh - 0.1,
+        corners.0 && qx <= wx + 1.5 && qy <= wy + 1.5,
+        corners.1 && qx + qw >= wx + ww - 1.5 && qy <= wy + 1.5,
+        corners.2 && qx + qw >= wx + ww - 1.5 && qy + qh >= wy + wh - 1.5,
+        corners.3 && qx <= wx + 1.5 && qy + qh >= wy + wh - 1.5,
     );
 
     push_rounded_rect_vertices_corners(qx, qy, qw, qh, target_w.corner_radius(), sw, sh, qc, clip_circle, extra_corners, Some(clip), out);
diff --git a/src/layout.rs b/src/layout.rs
index 54cc42f..3a10b2d 100644
--- a/src/layout.rs
+++ b/src/layout.rs
@@ -1347,10 +1347,10 @@ pub fn render_widget<T: Element + 'static>(pc: &mut dyn RenderTarget, w: &mut T,
         }
 
         let extra_corners = (
-            corners.0 && qx <= wx + 0.1 && qy <= wy + 0.1,
-            corners.1 && qx + qw >= wx + www - 0.1 && qy <= wy + 0.1,
-            corners.2 && qx + qw >= wx + www - 0.1 && qy + qh >= wy + whh - 0.1,
-            corners.3 && qx <= wx + 0.1 && qy + qh >= wy + whh - 0.1,
+            corners.0 && qx <= wx + 1.5 && qy <= wy + 1.5,
+            corners.1 && qx + qw >= wx + www - 1.5 && qy <= wy + 1.5,
+            corners.2 && qx + qw >= wx + www - 1.5 && qy + qh >= wy + whh - 1.5,
+            corners.3 && qx <= wx + 1.5 && qy + qh >= wy + whh - 1.5,
         );
 
         if extra_corners == (false, false, false, false) {
diff --git a/src/main.rs b/src/main.rs
index cd74d89..9fa802a 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -196,10 +196,10 @@ fn extra_quad_vertices(
     wy += top_room;
     wh -= top_room;
     let extra_corners = (
-        corners.0 && qx <= wx + 0.1 && qy <= wy + 0.1,
-        corners.1 && qx + qw >= wx + ww - 0.1 && qy <= wy + 0.1,
-        corners.2 && qx + qw >= wx + ww - 0.1 && qy + qh >= wy + wh - 0.1,
-        corners.3 && qx <= wx + 0.1 && qy + qh >= wy + wh - 0.1,
+        corners.0 && qx <= wx + 1.5 && qy <= wy + 1.5,
+        corners.1 && qx + qw >= wx + ww - 1.5 && qy <= wy + 1.5,
+        corners.2 && qx + qw >= wx + ww - 1.5 && qy + qh >= wy + wh - 1.5,
+        corners.3 && qx <= wx + 1.5 && qy + qh >= wy + wh - 1.5,
     );
 
     rounded_rect_vertices_corners(qx, qy, qw, qh, w.corner_radius(), sw, sh, qc, extra_corners)