| 1 | //! Transformations for graphics objects |
|---|---|
| 2 | |
| 3 | use crate::geometry::Point; |
| 4 | |
| 5 | /// Transform operations |
| 6 | pub trait Transform { |
| 7 | /// Move the origin of an object by a given number of (x, y) pixels, returning a new object |
| 8 | fn translate(&self, by: Point) -> Self; |
| 9 | |
| 10 | /// Move the origin of an object by a given number of (x, y) pixels, mutating the object |
| 11 | /// in place |
| 12 | fn translate_mut(&mut self, by: Point) -> &mut Self; |
| 13 | } |
| 14 |
