diff options
Diffstat (limited to 'src/layout/frame.rs')
| -rw-r--r-- | src/layout/frame.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/layout/frame.rs b/src/layout/frame.rs index 6cecc7a3..f1dc07e6 100644 --- a/src/layout/frame.rs +++ b/src/layout/frame.rs @@ -35,6 +35,14 @@ impl Frame { self.push(pos + subpos, element); } } + + /// Translate the positions of all elements in the frame by adding the + /// argument to their position. + pub fn translate(&mut self, amount: Point) { + for (pos, _) in &mut self.elements { + *pos += amount; + } + } } /// The building block frames are composed of. |
