diff options
| author | Laurenz <laurmaedje@gmail.com> | 2022-09-19 11:14:58 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2022-09-19 11:16:05 +0200 |
| commit | 4ec3bcee487c1567bc6551f81d4f69eee4379076 (patch) | |
| tree | 84ece5a894679adbe06c43712af685c5561a83ca /src/library | |
| parent | e5f958b92161732ae46ccc66ce3d6eea213cf925 (diff) | |
Remove pins and memoization
Diffstat (limited to 'src/library')
| -rw-r--r-- | src/library/layout/grid.rs | 4 | ||||
| -rw-r--r-- | src/library/layout/locate.rs | 14 | ||||
| -rw-r--r-- | src/library/layout/mod.rs | 2 | ||||
| -rw-r--r-- | src/library/mod.rs | 2 |
4 files changed, 0 insertions, 22 deletions
diff --git a/src/library/layout/grid.rs b/src/library/layout/grid.rs index 5e86f3d0..93dbf97e 100644 --- a/src/library/layout/grid.rs +++ b/src/library/layout/grid.rs @@ -204,9 +204,7 @@ impl<'a> GridLayouter<'a> { /// Determines the columns sizes and then layouts the grid row-by-row. pub fn layout(mut self) -> TypResult<Vec<Frame>> { - self.ctx.pins.freeze(); self.measure_columns()?; - self.ctx.pins.unfreeze(); for y in 0 .. self.rows.len() { // Skip to next region if current one is full, but only for content @@ -372,12 +370,10 @@ impl<'a> GridLayouter<'a> { pod.base.x = self.regions.base.x; } - self.ctx.pins.freeze(); let mut sizes = node .layout(self.ctx, &pod, self.styles)? .into_iter() .map(|frame| frame.height()); - self.ctx.pins.unfreeze(); // For each region, we want to know the maximum height any // column requires. diff --git a/src/library/layout/locate.rs b/src/library/layout/locate.rs deleted file mode 100644 index 74480b91..00000000 --- a/src/library/layout/locate.rs +++ /dev/null @@ -1,14 +0,0 @@ -use crate::library::prelude::*; -use crate::model::{Group, LocateNode}; - -/// Format content with access to its location on the page. -pub fn locate(_: &mut Machine, args: &mut Args) -> TypResult<Value> { - let node = LocateNode::single(args.expect("recipe")?); - Ok(Value::Content(Content::Locate(node))) -} - -/// Create a new group of locatable elements. -pub fn group(_: &mut Machine, args: &mut Args) -> TypResult<Value> { - let key = args.expect("key")?; - Ok(Value::dynamic(Group::new(key))) -} diff --git a/src/library/layout/mod.rs b/src/library/layout/mod.rs index 6cf5b550..588b15aa 100644 --- a/src/library/layout/mod.rs +++ b/src/library/layout/mod.rs @@ -5,7 +5,6 @@ mod columns; mod container; mod flow; mod grid; -mod locate; mod pad; mod page; mod place; @@ -17,7 +16,6 @@ pub use columns::*; pub use container::*; pub use flow::*; pub use grid::*; -pub use locate::*; pub use pad::*; pub use page::*; pub use place::*; diff --git a/src/library/mod.rs b/src/library/mod.rs index c1a645fb..566a4f26 100644 --- a/src/library/mod.rs +++ b/src/library/mod.rs @@ -57,8 +57,6 @@ pub fn new() -> Scope { std.def_node::<layout::ColumnsNode>("columns"); std.def_node::<layout::ColbreakNode>("colbreak"); std.def_node::<layout::PlaceNode>("place"); - std.def_fn("locate", layout::locate); - std.def_fn("group", layout::group); // Graphics. std.def_node::<graphics::ImageNode>("image"); |
