diff options
| author | Laurenz <laurmaedje@gmail.com> | 2021-01-15 16:53:02 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2021-01-15 16:53:02 +0100 |
| commit | d763f0f5a6a700352ee8926c15c8e58624f705c9 (patch) | |
| tree | d287edfdab9793a796404516c7313689e4e69964 /src/layout/mod.rs | |
| parent | 0f0416054f263b80ccec1a463ce4ab20913bdf71 (diff) | |
Split state and scopes, less ref-counting 🔀
Diffstat (limited to 'src/layout/mod.rs')
| -rw-r--r-- | src/layout/mod.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/layout/mod.rs b/src/layout/mod.rs index 714bac4b..44960de7 100644 --- a/src/layout/mod.rs +++ b/src/layout/mod.rs @@ -8,7 +8,7 @@ mod spacing; mod stack; mod text; -use crate::env::{ResourceId, SharedEnv}; +use crate::env::{Env, ResourceId}; use crate::geom::*; use crate::shaping::Shaped; @@ -21,7 +21,7 @@ pub use stack::*; pub use text::*; /// Layout a tree into a collection of frames. -pub fn layout(tree: &Tree, env: SharedEnv) -> Vec<Frame> { +pub fn layout(tree: &Tree, env: &mut Env) -> Vec<Frame> { tree.layout(&mut LayoutContext { env }) } @@ -65,10 +65,10 @@ pub trait Layout { } /// The context for layouting. -#[derive(Debug, Clone)] -pub struct LayoutContext { +#[derive(Debug)] +pub struct LayoutContext<'a> { /// The environment from which fonts are gathered. - pub env: SharedEnv, + pub env: &'a mut Env, } /// A collection of areas to layout into. |
