tabs: pad scroll containers for shadow bleed
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user