summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMartin <mhaug@live.de>2021-06-18 13:01:55 +0200
committerMartin <mhaug@live.de>2021-06-18 13:01:55 +0200
commit80a9b300d1acb8821ac0600aad3d2135ad9587bd (patch)
tree6626ba8891fa4db4e3a1cb13f7f4b27fc05989bf /tests
parent7db78d83bedf62adea0d715c9a2a179ce23a1a48 (diff)
Ref count the frames
Diffstat (limited to 'tests')
-rw-r--r--tests/typeset.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/typeset.rs b/tests/typeset.rs
index c6d3e8f1..8fc7712a 100644
--- a/tests/typeset.rs
+++ b/tests/typeset.rs
@@ -208,7 +208,7 @@ fn test_part(
i: usize,
compare_ref: bool,
lines: u32,
-) -> (bool, bool, Vec<Frame>) {
+) -> (bool, bool, Vec<Rc<Frame>>) {
let map = LineMap::new(src);
let (local_compare_ref, ref_diags) = parse_metadata(src, &map);
let compare_ref = local_compare_ref.unwrap_or(compare_ref);
@@ -345,7 +345,7 @@ fn print_diag(diag: &Diag, map: &LineMap, lines: u32) {
println!("{}: {}-{}: {}", diag.level, start, end, diag.message);
}
-fn draw(cache: &Cache, frames: &[Frame], dpi: f32) -> Pixmap {
+fn draw(cache: &Cache, frames: &[Rc<Frame>], dpi: f32) -> Pixmap {
let pad = Length::pt(5.0);
let height = pad + frames.iter().map(|l| l.size.height + pad).sum::<Length>();
@@ -381,8 +381,8 @@ fn draw(cache: &Cache, frames: &[Frame], dpi: f32) -> Pixmap {
None,
);
- for (pos, element) in &frame.elements {
- let global = origin + *pos;
+ for (pos, element) in frame.elements() {
+ let global = origin + pos;
let x = global.x.to_pt() as f32;
let y = global.y.to_pt() as f32;
let ts = ts.pre_translate(x, y);