summaryrefslogtreecommitdiff
path: root/src/layout/par.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2021-03-12 14:12:30 +0100
committerLaurenz <laurmaedje@gmail.com>2021-03-12 14:12:30 +0100
commit584a43277dbfbdba834a2681afe63d10598db3f9 (patch)
tree2a7b8d1f6b41fa39996c907d8d582b4c52448fcd /src/layout/par.rs
parentffcb8cd97a7107bfd66805b1073c5ef3e0dd59a7 (diff)
Rename ChildAlign to LayoutAligns ✏
Diffstat (limited to 'src/layout/par.rs')
-rw-r--r--src/layout/par.rs14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/layout/par.rs b/src/layout/par.rs
index 9a5d26dd..8e8f5aac 100644
--- a/src/layout/par.rs
+++ b/src/layout/par.rs
@@ -8,12 +8,12 @@ pub struct NodePar {
/// The children are placed in lines along the `cross` direction. The lines
/// are stacked along the `main` direction.
pub dirs: LayoutDirs,
+ /// How to align this paragraph in its parent.
+ pub aligns: LayoutAligns,
/// The spacing to insert after each line.
pub line_spacing: Length,
/// The nodes to be arranged in a paragraph.
pub children: Vec<Node>,
- /// How to align this paragraph in _its_ parent.
- pub align: ChildAlign,
}
impl Layout for NodePar {
@@ -22,15 +22,17 @@ impl Layout for NodePar {
for child in &self.children {
match child.layout(ctx, &layouter.areas) {
Layouted::Spacing(spacing) => layouter.push_spacing(spacing),
- Layouted::Frame(frame, align) => layouter.push_frame(frame, align.cross),
- Layouted::Frames(frames, align) => {
+ Layouted::Frame(frame, aligns) => {
+ layouter.push_frame(frame, aligns.cross)
+ }
+ Layouted::Frames(frames, aligns) => {
for frame in frames {
- layouter.push_frame(frame, align.cross);
+ layouter.push_frame(frame, aligns.cross);
}
}
}
}
- Layouted::Frames(layouter.finish(), self.align)
+ Layouted::Frames(layouter.finish(), self.aligns)
}
}