git.lucas.co / cce-designer
graphic design tool
git clone https://git.lucas.co/cce-designer.git

commita87ddc8b6a95f0a3e671ef9b22fc437307430e0b
parentdbd71cfc53
authorLucas Galante <[email protected]>
date2026-08-26 15:31
refactor: the drop-target glow is one Prim::Glow

The 14 stacked rounded rects (visibly banded) become a single feathered
aura prim (cce-ui@…) — per-vertex alpha rings, per-pixel smooth. Same
animated state, same colors, same reach.

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

 src/render.rs | 31 +++++++++++--------------------
 1 file changed, 11 insertions(+), 20 deletions(-)

diff --git a/src/render.rs b/src/render.rs
index 53174c3..7b04e6a 100644
--- a/src/render.rs
+++ b/src/render.rs
@@ -374,27 +374,18 @@ impl State {
                 }
                 // Drop-target glow, from the ANIMATED state (tick_frame owns
                 // it): position glides between cells, alpha fades in/out.
-                // The feather is many thin layers on a quadratic spacing —
-                // dense rings near the cell, sparse far out — so cumulative
-                // coverage falls off smoothly, a vignette rather than steps.
-                // Drawn under the node bodies: with grid snap the glow reads
-                // as a soft aura around the dragged body.
+                // One Prim::Glow — per-vertex-alpha rings the GPU
+                // interpolates, a genuinely smooth vignette (the stacked-rect
+                // version banded visibly). Drawn under the node bodies: with
+                // grid snap the glow reads as a soft aura around the dragged
+                // body.
                 if let Some(g) = self.drop_glow {
-                    const LAYERS: usize = 14;
-                    const REACH: f32 = 30.0;
-                    for i in (0..LAYERS).rev() {
-                        let t = i as f32 / (LAYERS - 1) as f32;
-                        let grow = REACH * t * t;
-                        // Inner layers carry slightly more weight so the core
-                        // stays warm while the rim dissolves.
-                        let layer_a = g.alpha * 0.020 * (1.0 - 0.5 * t);
-                        pc.rounded_rect(
-                            rect(g.x - grow, g.y - grow, g.w + 2.0 * grow, g.h + 2.0 * grow),
-                            cell_r + grow,
-                            (true, true, true, true),
-                            [1.0, 0.72, 0.80, layer_a],
-                        );
-                    }
+                    pc.glow(
+                        rect(g.x, g.y, g.w, g.h),
+                        cell_r,
+                        30.0,
+                        [1.0, 0.72, 0.80, 0.18 * g.alpha],
+                    );
                 }
                 for (qx, qy, qw, qh, highlighted) in bodies {
                     if highlighted {