From 042103f131a5c35bc4794819d5d964610c118253 Mon Sep 17 00:00:00 2001 From: The_miro Date: Wed, 22 Jul 2026 23:13:29 +0200 Subject: [PATCH] fix(astro-menu): clip card bloom so corners stop poking out of the rounded border MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit bordered()'s glow re-strokes the rounded ring at widths up to border+22, so half of each stroke falls outside the ring path. GTK clips a DrawingArea to its own square allocation: along the straight edges that trims the outward spill to nothing, but inside each corner the square patch between the arc and the widget corner is still in-allocation and got painted solid accent red — square corners peeking out from behind every rounded card border. Clip the glow passes to the ring's outer silhouette (the widget rect rounded by radius + border/2, exactly where the crisp stroke's outer edge runs) so the bloom only reads inward. Crisp stroke and fill are unchanged. Co-Authored-By: Claude Opus 4.8 --- desktopenvs/hyprdrive/astro-menu/lib/border.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/desktopenvs/hyprdrive/astro-menu/lib/border.py b/desktopenvs/hyprdrive/astro-menu/lib/border.py index 52bc7d4..ab9d2ed 100644 --- a/desktopenvs/hyprdrive/astro-menu/lib/border.py +++ b/desktopenvs/hyprdrive/astro-menu/lib/border.py @@ -49,11 +49,24 @@ def _make_draw(border: int, radius: int, color, fill_bg: bool, glow: bool): inset = border / 2 r, g, b = color if glow: + # The bloom strokes are up to 24px wide, so half of each spills OUTWARD + # past the ring. GTK clips a DrawingArea to its own (square) allocation, + # which along the straight edges trims that spill to nothing but inside + # each corner leaves the whole square patch outside the arc painted — + # solid red corners poking out from behind the rounded border. Clip the + # glow to the ring's own outer silhouette (the widget rect rounded by + # radius + inset, i.e. exactly where the crisp stroke's outer edge runs) + # so the bloom only ever reads inward and the card keeps a clean rounded + # outline. + cr.save() + _rounded_rect(cr, 0, 0, w, h, radius + inset) + cr.clip() for extra_w, alpha in _GLOW_LAYERS: _rounded_rect(cr, inset, inset, w - border, h - border, radius) cr.set_source_rgba(r, g, b, alpha) cr.set_line_width(border + extra_w) cr.stroke() + cr.restore() _rounded_rect(cr, inset, inset, w - border, h - border, radius) if fill_bg: cr.set_source_rgba(*FILL_COLOR, FILL_ALPHA)