Add Overlay component to gpui2

This commit is contained in:
Conrad Irwin 2023-11-15 22:58:30 -07:00
parent 8c14a8fa95
commit 74afa62a55
6 changed files with 259 additions and 32 deletions

View file

@ -421,6 +421,22 @@ impl<T> Bounds<T>
where
T: Add<T, Output = T> + Clone + Default + Debug,
{
pub fn top(&self) -> T {
self.origin.y.clone()
}
pub fn bottom(&self) -> T {
self.origin.y.clone() + self.size.height.clone()
}
pub fn left(&self) -> T {
self.origin.x.clone()
}
pub fn right(&self) -> T {
self.origin.x.clone() + self.size.width.clone()
}
pub fn upper_right(&self) -> Point<T> {
Point {
x: self.origin.x.clone() + self.size.width.clone(),