Implement Primitive::Cached
This commit is contained in:
parent
37f0d97159
commit
b74e7e7353
12 changed files with 151 additions and 105 deletions
|
|
@ -46,3 +46,14 @@ impl std::ops::Add<Vector> for Point {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl std::ops::Sub<Vector> for Point {
|
||||
type Output = Self;
|
||||
|
||||
fn sub(self, vector: Vector) -> Self {
|
||||
Self {
|
||||
x: self.x - vector.x,
|
||||
y: self.y - vector.y,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue