summaryrefslogtreecommitdiff
path: root/src/frame.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2021-11-18 00:58:32 +0100
committerLaurenz <laurmaedje@gmail.com>2021-11-18 00:58:32 +0100
commitb2e6a297893348a871fba8997017a9fc98d5674b (patch)
treec88f18c063d97d91712185c58ccf1cd745663cc1 /src/frame.rs
parentd9c529347d7f46eb2f4698d256b1906c1ced6b76 (diff)
Refactoring
Diffstat (limited to 'src/frame.rs')
-rw-r--r--src/frame.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/frame.rs b/src/frame.rs
index 94234ae9..9feb6959 100644
--- a/src/frame.rs
+++ b/src/frame.rs
@@ -64,6 +64,13 @@ impl Frame {
}
}
+ /// Move all elements in the frame by an offset.
+ pub fn translate(&mut self, offset: Point) {
+ for (point, _) in &mut self.elements {
+ *point += offset;
+ }
+ }
+
/// An iterator over all non-frame elements in this and nested frames.
pub fn elements(&self) -> Elements {
Elements { stack: vec![(0, Point::zero(), self)] }