Add padding to text::Span

This commit is contained in:
Héctor Ramón Jiménez 2024-07-28 13:56:39 +02:00
parent f7fe1edcbb
commit 2796a6bc97
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
4 changed files with 57 additions and 12 deletions

View file

@ -99,6 +99,20 @@ impl<T> From<Size<T>> for Vector<T> {
}
}
impl<T> std::ops::Add for Size<T>
where
T: std::ops::Add<Output = T>,
{
type Output = Size<T>;
fn add(self, rhs: Self) -> Self::Output {
Size {
width: self.width + rhs.width,
height: self.height + rhs.height,
}
}
}
impl<T> std::ops::Sub for Size<T>
where
T: std::ops::Sub<Output = T>,