diff options
| author | Laurenz <laurmaedje@gmail.com> | 2020-01-24 16:23:57 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2020-01-24 16:23:57 +0100 |
| commit | 0a087cd28bbee5fcdffbb9d49b0ba9f413ad7f92 (patch) | |
| tree | fe00c96969ed2ee69e6d3b42de8ff2558f792edd /src/library | |
| parent | 03fddaf3aea778057aedd74dbcb27bae971ec22f (diff) | |
Reorganize modules 🧱
Diffstat (limited to 'src/library')
| -rw-r--r-- | src/library/font.rs | 7 | ||||
| -rw-r--r-- | src/library/layout.rs | 3 | ||||
| -rw-r--r-- | src/library/mod.rs | 1 | ||||
| -rw-r--r-- | src/library/page.rs | 2 | ||||
| -rw-r--r-- | src/library/spacing.rs | 5 |
5 files changed, 13 insertions, 5 deletions
diff --git a/src/library/font.rs b/src/library/font.rs index b4a6218a..07707e90 100644 --- a/src/library/font.rs +++ b/src/library/font.rs @@ -1,4 +1,5 @@ use toddle::query::{FontWeight, FontStyle}; +use crate::size::FSize; use super::*; @@ -79,7 +80,7 @@ function! { #[derive(Debug, Clone, PartialEq)] pub struct FontSizeFunc { body: Option<SyntaxModel>, - size: Option<ScaleSize>, + size: Option<FSize>, } parse(header, body, ctx, errors, decos) { @@ -93,11 +94,11 @@ function! { layout(self, ctx, errors) { styled(&self.body, ctx, self.size, |t, s| { match s { - ScaleSize::Absolute(size) => { + FSize::Absolute(size) => { t.base_font_size = size; t.font_scale = 1.0; } - ScaleSize::Scaled(scale) => t.font_scale = scale, + FSize::Scaled(scale) => t.font_scale = scale, } }) } diff --git a/src/library/layout.rs b/src/library/layout.rs index fb8633b1..87e9c357 100644 --- a/src/library/layout.rs +++ b/src/library/layout.rs @@ -1,4 +1,5 @@ -use smallvec::smallvec; +use crate::size::PSize; +use crate::syntax::func::maps::{AxisMap, PosAxisMap}; use super::*; diff --git a/src/library/mod.rs b/src/library/mod.rs index e706642f..b570c48b 100644 --- a/src/library/mod.rs +++ b/src/library/mod.rs @@ -1,5 +1,6 @@ //! The standard library. +use crate::syntax::Scope; use crate::func::prelude::*; pub_use_mod!(font); diff --git a/src/library/page.rs b/src/library/page.rs index 25f81bc1..7e135f59 100644 --- a/src/library/page.rs +++ b/src/library/page.rs @@ -1,4 +1,6 @@ +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 6c818292..907d5f9b 100644 --- a/src/library/spacing.rs +++ b/src/library/spacing.rs @@ -1,5 +1,8 @@ +use crate::size::FSize; +use crate::layout::SpacingKind; + use super::*; -use ContentKind::*; +use self::ContentKind::*; function! { |
