desktop grid client
git clone https://git.lucas.co/cce-grid.git
cells: span-widen the corner radius like the rest of the DE
The cells drew at the raw config radius while every window clip,
compositor fallback cell, and cce-ui plate widens it by
corner_span_factor first — at corner_shape > 2 the unwidened
superellipse hugs the corner so tightly it reads nearly square, so the
cell arcs missed the tiled windows' corners. The radius (and with it the
recess depth) is now widened by cce_ui::layout::corner_span_factor and
clamped to a quarter sweep, matching the compositor's
widen_corner_radius; a tiled window's arc lands exactly on its cell's.
Co-Authored-By: Claude Fable 5 <[email protected]>
CLAUDE.md | 8 +++++---
src/main.rs | 10 +++++++++-
2 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/CLAUDE.md b/CLAUDE.md
index ff9bcc0..a06b083 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -24,6 +24,8 @@ This directory is its own git repository (gitsite-published, fetch-only
origin; committing locally is publishing). `cce-grid.service` autostarts it
with the session (WantedBy=cce-session.target); ccebuild installs both.
-Known MVP gaps: colors are passed to PaintCtx as raw sRGB (likely needs
-srgb_to_linear — the client renders brighter than the fallback), and corner
-sweeps are tighter than the compositor's span-widened superellipse.
+Corner radii follow the DE-wide convention: the caller widens the nominal
+radius by `cce_ui::layout::corner_span_factor()` (superellipse span
+compensation) before handing it to the primitives, clamped to a quarter
+sweep — same as the compositor's `widen_corner_radius`. An unwidened radius
+reads nearly square at corner_shape > 2 and misses the window corners.
diff --git a/src/main.rs b/src/main.rs
index 0346ca4..d50b73e 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -100,7 +100,15 @@ impl GridApp {
let lo = inset;
let len = st.cell_size - 2.0 * inset;
let s = p.scale;
- let radius = (st.corner_radius * s) as f32;
+ // Span-widened like every other corner in the DE (window clips,
+ // fallback cells, cce-ui plates): at corner_shape > 2 a raw-radius
+ // superellipse hugs the corner and reads nearly square, and a tiled
+ // window's widened arc must land exactly on its cell's. Clamped to a
+ // quarter sweep like the compositor's widen_corner_radius.
+ let cell_px = len * s;
+ let radius = ((st.corner_radius * s)
+ * cce_ui::layout::corner_span_factor() as f64)
+ .min(cell_px / 2.0) as f32;
let depth = radius.max(1.0);
let col0 = (p.x / period).floor() as i64;