Introduce visible_bounds operation for Container
This commit is contained in:
parent
e29754f32d
commit
e2ba7ece83
16 changed files with 201 additions and 25 deletions
|
|
@ -197,3 +197,18 @@ where
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<T> std::ops::Sub<Vector<T>> for Rectangle<T>
|
||||
where
|
||||
T: std::ops::Sub<Output = T>,
|
||||
{
|
||||
type Output = Rectangle<T>;
|
||||
|
||||
fn sub(self, translation: Vector<T>) -> Self {
|
||||
Rectangle {
|
||||
x: self.x - translation.x,
|
||||
y: self.y - translation.y,
|
||||
..self
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue