diff options
| author | Laurenz <laurmaedje@gmail.com> | 2021-03-19 17:57:31 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2021-03-19 17:57:31 +0100 |
| commit | 264a7dedd42e27cd9e604037640cf0594b2ec46b (patch) | |
| tree | d26feea399d54bb86bd44878f40293983bf5251d /src/layout/fixed.rs | |
| parent | ca3df70e2a5069832d7d2135967674c34a155442 (diff) | |
Scheduled maintenance 🔨
- New naming scheme
- TextNode instead of NodeText
- CallExpr instead of ExprCall
- ...
- Less glob imports
- Removes Value::Args variant
- Removes prelude
- Renames Layouted to Fragment
- Moves font into env
- Moves shaping into layout
- Moves frame into separate module
Diffstat (limited to 'src/layout/fixed.rs')
| -rw-r--r-- | src/layout/fixed.rs | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/layout/fixed.rs b/src/layout/fixed.rs index a9554a07..e3365668 100644 --- a/src/layout/fixed.rs +++ b/src/layout/fixed.rs @@ -1,9 +1,8 @@ use super::*; -use crate::geom::Linear; /// A node that can fix its child's width and height. #[derive(Debug, Clone, PartialEq)] -pub struct NodeFixed { +pub struct FixedNode { /// The fixed width, if any. pub width: Option<Linear>, /// The fixed height, if any. @@ -12,8 +11,8 @@ pub struct NodeFixed { pub child: Node, } -impl Layout for NodeFixed { - fn layout(&self, ctx: &mut LayoutContext, areas: &Areas) -> Layouted { +impl Layout for FixedNode { + fn layout(&self, ctx: &mut LayoutContext, areas: &Areas) -> Fragment { let Areas { current, full, .. } = areas; let size = Size::new( self.width.map(|w| w.resolve(full.width)).unwrap_or(current.width), @@ -31,8 +30,8 @@ impl Layout for NodeFixed { } } -impl From<NodeFixed> for NodeAny { - fn from(fixed: NodeFixed) -> Self { +impl From<FixedNode> for AnyNode { + fn from(fixed: FixedNode) -> Self { Self::new(fixed) } } |
