diff options
| author | Laurenz <laurmaedje@gmail.com> | 2021-06-30 11:40:27 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2021-06-30 11:40:27 +0200 |
| commit | 470f8001a1dba0022ec9d3e46c67c3bbc31359be (patch) | |
| tree | d68f60533201658148ea508c90ba704f806561d5 /src/layout/mod.rs | |
| parent | 45812b700114a51f0ee21e31f4454cde3729eaf5 (diff) | |
No more collisions between syntax::Tree and layout::Tree
Diffstat (limited to 'src/layout/mod.rs')
| -rw-r--r-- | src/layout/mod.rs | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/layout/mod.rs b/src/layout/mod.rs index 7ba556a1..e8bdab62 100644 --- a/src/layout/mod.rs +++ b/src/layout/mod.rs @@ -37,7 +37,11 @@ use crate::geom::*; use crate::loading::Loader; /// Layout a tree into a collection of frames. -pub fn layout(loader: &mut dyn Loader, cache: &mut Cache, tree: &Tree) -> Vec<Rc<Frame>> { +pub fn layout( + loader: &mut dyn Loader, + cache: &mut Cache, + tree: &LayoutTree, +) -> Vec<Rc<Frame>> { tree.layout(&mut LayoutContext { loader, cache, @@ -48,12 +52,12 @@ pub fn layout(loader: &mut dyn Loader, cache: &mut Cache, tree: &Tree) -> Vec<Rc /// A tree of layout nodes. #[derive(Debug, Clone, PartialEq)] -pub struct Tree { +pub struct LayoutTree { /// Runs of pages with the same properties. pub runs: Vec<PageRun>, } -impl Tree { +impl LayoutTree { /// Layout the tree into a collection of frames. pub fn layout(&self, ctx: &mut LayoutContext) -> Vec<Rc<Frame>> { self.runs.iter().flat_map(|run| run.layout(ctx)).collect() |
