Add a `transformed()` method to `Outline` and `Contour`.
@@ -178,6 +178,11 @@ impl Outline {
self.bounds = new_bounds.unwrap_or_else(|| RectF::default());
}
+ pub fn transformed(mut self, transform: &Transform2F) -> Outline {
+ self.transform(transform);
+ self
+ }
+
pub fn apply_perspective(&mut self, perspective: &Perspective) {
let mut new_bounds = None;
for contour in &mut self.contours {
@@ -614,6 +619,12 @@ impl Contour {
}
}
+ #[inline]
+ pub fn transformed(mut self, transform: &Transform2F) -> Contour {
+ self.transform(transform);
+ self
+ }
+
pub fn apply_perspective(&mut self, perspective: &Perspective) {
for (point_index, point) in self.points.iter_mut().enumerate() {
*point = *perspective * *point;
