Revert "gpui: Fix overflow_hidden to support clip with border radius" (#37480)
This reverts commit 40199266b6.
The issue with the commit is: ContentMask<Pixels>::intersect is doing
intersection of corner radii which makes inner containers use the max
corner radius out of all the parents when it should be more complex to
correctly clip children (clip sorting..?)
Release Notes:
- N/A
This commit is contained in:
@@ -1283,8 +1283,6 @@ pub(crate) struct DispatchEventResult {
|
||||
pub struct ContentMask<P: Clone + Debug + Default + PartialEq> {
|
||||
/// The bounds
|
||||
pub bounds: Bounds<P>,
|
||||
/// The corner radii of the content mask.
|
||||
pub corner_radii: Corners<P>,
|
||||
}
|
||||
|
||||
impl ContentMask<Pixels> {
|
||||
@@ -1292,31 +1290,13 @@ impl ContentMask<Pixels> {
|
||||
pub fn scale(&self, factor: f32) -> ContentMask<ScaledPixels> {
|
||||
ContentMask {
|
||||
bounds: self.bounds.scale(factor),
|
||||
corner_radii: self.corner_radii.scale(factor),
|
||||
}
|
||||
}
|
||||
|
||||
/// Intersect the content mask with the given content mask.
|
||||
pub fn intersect(&self, other: &Self) -> Self {
|
||||
let bounds = self.bounds.intersect(&other.bounds);
|
||||
ContentMask {
|
||||
bounds,
|
||||
corner_radii: Corners {
|
||||
top_left: self.corner_radii.top_left.max(other.corner_radii.top_left),
|
||||
top_right: self
|
||||
.corner_radii
|
||||
.top_right
|
||||
.max(other.corner_radii.top_right),
|
||||
bottom_right: self
|
||||
.corner_radii
|
||||
.bottom_right
|
||||
.max(other.corner_radii.bottom_right),
|
||||
bottom_left: self
|
||||
.corner_radii
|
||||
.bottom_left
|
||||
.max(other.corner_radii.bottom_left),
|
||||
},
|
||||
}
|
||||
ContentMask { bounds }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2577,7 +2557,6 @@ impl Window {
|
||||
origin: Point::default(),
|
||||
size: self.viewport_size,
|
||||
},
|
||||
..Default::default()
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user