diff options
| author | Laurenz <laurmaedje@gmail.com> | 2021-11-18 00:58:32 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2021-11-18 00:58:32 +0100 |
| commit | b2e6a297893348a871fba8997017a9fc98d5674b (patch) | |
| tree | c88f18c063d97d91712185c58ccf1cd745663cc1 /src/frame.rs | |
| parent | d9c529347d7f46eb2f4698d256b1906c1ced6b76 (diff) | |
Refactoring
Diffstat (limited to 'src/frame.rs')
| -rw-r--r-- | src/frame.rs | 7 |
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)] } |
