tabs: pad scroll containers for shadow bleed

This commit is contained in:
2026-11-16 07:50:39 +07:00
parent de2980712f
commit 28674d6d6a
3 changed files with 41 additions and 11 deletions
+15
View File
@@ -377,6 +377,21 @@ impl Elevation {
}
}
/// How far the shadow layers paint past the element's bounds.
pub fn bleed(self) -> Pixels {
self.layers.iter().fold(px(0.), |bleed, layer| {
if layer.color.a > 0. {
bleed.max(
layer.offset_x.abs().max(layer.offset_y.abs())
+ layer.blur_radius
+ layer.spread_radius,
)
} else {
bleed
}
})
}
/// The gpui shadow list an overlay panel paints with.
pub fn shadows(self) -> Vec<gpui::BoxShadow> {
self.layers