diff options
| author | Laurenz <laurmaedje@gmail.com> | 2022-10-28 16:43:38 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2022-10-28 16:43:38 +0200 |
| commit | 95e9134a3c7d7a14d8c8928413fdffc665671895 (patch) | |
| tree | 822b5f6c2d23aba33cfe4d199405e493e37c3d70 /tests | |
| parent | 66030ae5d73d85a0463562230b87f8ec7554c746 (diff) | |
Refactor `geom` module
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/typeset.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/typeset.rs b/tests/typeset.rs index 26a0c8b0..b5c14cb3 100644 --- a/tests/typeset.rs +++ b/tests/typeset.rs @@ -17,7 +17,7 @@ use walkdir::WalkDir; use typst::diag::{FileError, FileResult}; use typst::font::{Font, FontBook}; use typst::frame::{Element, Frame}; -use typst::geom::{Length, RgbaColor, Sides}; +use typst::geom::{Abs, RgbaColor, Sides}; use typst::library::layout::PageNode; use typst::library::text::{TextNode, TextSize}; use typst::model::{Smart, StyleMap, Value}; @@ -150,13 +150,13 @@ fn config() -> Config { // exactly 100pt wide. Page height is unbounded and font size is 10pt so // that it multiplies to nice round numbers. let mut styles = StyleMap::new(); - styles.set(PageNode::WIDTH, Smart::Custom(Length::pt(120.0).into())); + styles.set(PageNode::WIDTH, Smart::Custom(Abs::pt(120.0).into())); styles.set(PageNode::HEIGHT, Smart::Auto); styles.set( PageNode::MARGINS, - Sides::splat(Some(Smart::Custom(Length::pt(10.0).into()))), + Sides::splat(Some(Smart::Custom(Abs::pt(10.0).into()))), ); - styles.set(TextNode::SIZE, TextSize(Length::pt(10.0).into())); + styles.set(TextNode::SIZE, TextSize(Abs::pt(10.0).into())); // Hook up helpers into the global scope. let mut std = typst::library::scope(); @@ -653,7 +653,7 @@ fn render(frames: &[Frame]) -> sk::Pixmap { let pixmaps: Vec<_> = frames .iter() .map(|frame| { - let limit = Length::cm(100.0); + let limit = Abs::cm(100.0); if frame.width() > limit || frame.height() > limit { panic!("overlarge frame: {:?}", frame.size()); } |
