summaryrefslogtreecommitdiff
path: root/src/layout/frame.rs
diff options
context:
space:
mode:
authorMartin Haug <mhaug@live.de>2021-06-08 11:05:09 +0200
committerLaurenz <laurmaedje@gmail.com>2021-06-09 22:44:40 +0200
commit29cfef0a6dfef5820bda339d327638e285aaf4d3 (patch)
tree7a2e16b4c97d4259da1eb63deaa716b620feb4df /src/layout/frame.rs
parent73fa2eda2c23bd3baeb9e22b99eb0bfb183fc638 (diff)
Add a grid layouter
Diffstat (limited to 'src/layout/frame.rs')
-rw-r--r--src/layout/frame.rs8
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.