diff options
Diffstat (limited to 'src/library/align.rs')
| -rw-r--r-- | src/library/align.rs | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/src/library/align.rs b/src/library/align.rs deleted file mode 100644 index ca2c787b..00000000 --- a/src/library/align.rs +++ /dev/null @@ -1,35 +0,0 @@ -use crate::func::prelude::*; -use super::maps::{PosAxisMap, AlignmentKey}; - - -function! { - /// `align`: Aligns content along the layouting axes. - #[derive(Debug, PartialEq)] - pub struct AlignFunc { - body: Option<SyntaxTree>, - map: PosAxisMap<AlignmentKey>, - } - - parse(header, body, ctx) { - AlignFunc { - body: parse!(optional: body, ctx), - map: PosAxisMap::new(&mut header.args)?, - } - } - - layout(self, mut ctx) { - ctx.base = ctx.spaces[0].dimensions; - - let map = self.map.dedup(ctx.axes, |alignment| alignment.axis(ctx.axes))?; - for &axis in &[Primary, Secondary] { - if let Some(alignment) = map.get(axis) { - *ctx.alignment.get_mut(axis) = alignment.to_generic(ctx.axes, axis)?; - } - } - - match &self.body { - Some(body) => vec![AddMultiple(layout(&body, ctx).await?)], - None => vec![SetAlignment(ctx.alignment)], - } - } -} |
