From ca0c7b85c9538f11824ec4ad609d76413c124798 Mon Sep 17 00:00:00 2001 From: nolight132 Date: Sun, 29 Nov 2026 18:10:14 +0100 Subject: [PATCH] fix(gpui): clip a shadow to the device pixels its element fills --- crates/gpui/src/window.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/crates/gpui/src/window.rs b/crates/gpui/src/window.rs index 89f7ada..2f08d9a 100644 --- a/crates/gpui/src/window.rs +++ b/crates/gpui/src/window.rs @@ -5521,7 +5521,9 @@ impl Window { let scale_factor = self.scale_factor(); let content_mask = self.snapped_content_mask(); let opacity = self.element_opacity(); - let element_bounds = self.cover_bounds(bounds); + // The clip ends on the same device pixels as the element's fill, or a fractional edge + // leaves a row with neither fill nor shadow. + let element_bounds = self.snap_bounds(bounds); let element_corner_radii = corner_radii.scale(scale_factor); for shadow in shadows { if shadow.inset { @@ -5592,7 +5594,7 @@ impl Window { let scale_factor = self.scale_factor(); let content_mask = self.snapped_content_mask(); let opacity = self.element_opacity(); - let element_bounds = self.cover_bounds(bounds); + let element_bounds = self.snap_bounds(bounds); let element_corner_radii = corner_radii.scale(scale_factor); for shadow in shadows { if !shadow.inset {