summaryrefslogtreecommitdiff
path: root/library/src/layout/flow.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2022-12-09 10:21:11 +0100
committerLaurenz <laurmaedje@gmail.com>2022-12-09 10:21:11 +0100
commitcd089b6194c57b2e8dff70efaa7cbd53035f7327 (patch)
treef5466a0e2f8633aa609276c0c2794911c7e9252a /library/src/layout/flow.rs
parent495b525694aa5901385f3acad043b4a9f3ebb911 (diff)
Align set rule
Diffstat (limited to 'library/src/layout/flow.rs')
-rw-r--r--library/src/layout/flow.rs14
1 files changed, 2 insertions, 12 deletions
diff --git a/library/src/layout/flow.rs b/library/src/layout/flow.rs
index 0b6454a0..b78f3932 100644
--- a/library/src/layout/flow.rs
+++ b/library/src/layout/flow.rs
@@ -125,7 +125,7 @@ impl<'a> FlowLayouter<'a> {
par: &ParNode,
styles: StyleChain,
) -> SourceResult<()> {
- let aligns = Axes::new(styles.get(ParNode::ALIGN), Align::Top);
+ let aligns = styles.get(AlignNode::ALIGNS).resolve(styles);
let leading = styles.get(ParNode::LEADING);
let consecutive = self.last_was_par;
let fragment = par.layout(
@@ -172,17 +172,7 @@ impl<'a> FlowLayouter<'a> {
}
// How to align the block.
- let aligns = Axes::new(
- // For non-expanding paragraphs it is crucial that we align the
- // whole paragraph as it is itself aligned.
- styles.get(ParNode::ALIGN),
- // Vertical align node alignment is respected by the flow.
- block
- .to::<AlignNode>()
- .and_then(|aligned| aligned.aligns.y)
- .map(|align| align.resolve(styles))
- .unwrap_or(Align::Top),
- );
+ let aligns = styles.get(AlignNode::ALIGNS).resolve(styles);
// Layout the block itself.
let sticky = styles.get(BlockNode::STICKY);