diff options
Diffstat (limited to 'src/library')
| -rw-r--r-- | src/library/layout.rs | 6 | ||||
| -rw-r--r-- | src/library/mod.rs | 2 | ||||
| -rw-r--r-- | src/library/page.rs | 1 | ||||
| -rw-r--r-- | src/library/spacing.rs | 6 |
4 files changed, 9 insertions, 6 deletions
diff --git a/src/library/layout.rs b/src/library/layout.rs index 87e9c357..d36cd0e0 100644 --- a/src/library/layout.rs +++ b/src/library/layout.rs @@ -1,5 +1,4 @@ use crate::size::PSize; -use crate::syntax::func::maps::{AxisMap, PosAxisMap}; use super::*; @@ -21,7 +20,10 @@ function! { layout(self, ctx, errors) { ctx.base = ctx.spaces[0].dimensions; - let map = self.map.dedup(errors, ctx.axes, |alignment| alignment.axis(ctx.axes)); + let map = self.map.dedup(errors, ctx.axes, |alignment| { + alignment.axis().map(|s| s.to_generic(ctx.axes)) + }); + for &axis in &[Primary, Secondary] { if let Some(Spanned { v: alignment, span }) = map.get_spanned(axis) { if let Some(generic) = alignment.to_generic(ctx.axes, axis) { diff --git a/src/library/mod.rs b/src/library/mod.rs index b570c48b..02311c0d 100644 --- a/src/library/mod.rs +++ b/src/library/mod.rs @@ -1,4 +1,4 @@ -//! The standard library. +//! The _Typst_ standard library. use crate::syntax::Scope; use crate::func::prelude::*; diff --git a/src/library/page.rs b/src/library/page.rs index 7e135f59..e2a4d687 100644 --- a/src/library/page.rs +++ b/src/library/page.rs @@ -1,6 +1,5 @@ use crate::size::Size; use crate::style::{Paper, PaperClass}; -use crate::syntax::func::maps::{AxisMap, PaddingMap}; use super::*; diff --git a/src/library/spacing.rs b/src/library/spacing.rs index 907d5f9b..b948153d 100644 --- a/src/library/spacing.rs +++ b/src/library/spacing.rs @@ -11,7 +11,7 @@ function! { pub struct LineBreakFunc; parse(default) - layout(self, ctx, errors) { vec![FinishLine] } + layout(self, ctx, errors) { vec![BreakLine] } } function! { @@ -65,8 +65,10 @@ function! { } } -/// The different kinds of content that can be spaced. +/// The different kinds of content that can be spaced. Used as a metadata type +/// for the [`ContentSpacingFunc`]. #[derive(Debug, Copy, Clone, Eq, PartialEq)] +#[allow(missing_docs)] pub enum ContentKind { Word, Line, |
