diff options
| author | Laurenz <laurmaedje@gmail.com> | 2020-08-01 19:15:55 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2020-08-01 19:15:55 +0200 |
| commit | 659248d52ff9e6be4dad7c4555bd62899671ad55 (patch) | |
| tree | 610f382adc09524a08c5cbb941e46103117a88e5 /tests | |
| parent | 04c05502bee50f7657dc2d88c60eb935b068a284 (diff) | |
Raw lengths 🚲
Replace unitless length with raw f64 and introduce length type with unit.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/src/render.py | 5 | ||||
| -rw-r--r-- | tests/src/typeset.rs | 5 |
2 files changed, 6 insertions, 4 deletions
diff --git a/tests/src/render.py b/tests/src/render.py index 3b6c96f8..80f165a1 100644 --- a/tests/src/render.py +++ b/tests/src/render.py @@ -170,8 +170,9 @@ class BoxRenderer: return self.img -def pix(points): - return int(4 * points) +# the number of pixels per raw unit +def pix(raw): + return int(4 * raw) def overlap(a, b): return (a[0] < b[2] and b[0] < a[2]) and (a[1] < b[3] and b[1] < a[3]) diff --git a/tests/src/typeset.rs b/tests/src/typeset.rs index af73bd02..ccce8820 100644 --- a/tests/src/typeset.rs +++ b/tests/src/typeset.rs @@ -14,8 +14,9 @@ use futures_executor::block_on; use typstc::Typesetter; use typstc::font::DynProvider; +use typstc::geom::{Size, Value4}; use typstc::layout::MultiLayout; -use typstc::length::{Length, Size, Value4}; +use typstc::length::Length; use typstc::style::PageStyle; use typstc::paper::PaperClass; use typstc::export::pdf; @@ -85,7 +86,7 @@ fn test(name: &str, src: &str, index: &FsIndex) -> DynResult<()> { typesetter.set_page_style(PageStyle { class: PaperClass::Custom, - dimensions: Size::with_all(Length::pt(250.0)), + dimensions: Size::with_all(Length::pt(250.0).as_raw()), margins: Value4::with_all(None), }); |
