diff options
| author | Martin Haug <mhaug@live.de> | 2022-05-27 16:39:06 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-05-27 16:39:06 +0200 |
| commit | 73086b5a7c1b0f9f638165803c237901499adb64 (patch) | |
| tree | c120a2449aaf325cb675ea3363ee69758a734d86 /src/export | |
| parent | 99cb655832161d4ebec73273a15453a8f6acc1b7 (diff) | |
| parent | 8ba11b0722599892499337b3272cec38945d11de (diff) | |
Merge pull request #71 from typst/pins
Diffstat (limited to 'src/export')
| -rw-r--r-- | src/export/pdf.rs | 11 | ||||
| -rw-r--r-- | src/export/render.rs | 1 |
2 files changed, 7 insertions, 5 deletions
diff --git a/src/export/pdf.rs b/src/export/pdf.rs index aeb5c47e..c050bfc5 100644 --- a/src/export/pdf.rs +++ b/src/export/pdf.rs @@ -333,14 +333,14 @@ impl<'a> PdfExporter<'a> { .action_type(ActionType::Uri) .uri(Str(uri.as_str().as_bytes())); } - Destination::Internal(page, point) => { - let page = page - 1; - let height = page_heights[page]; + Destination::Internal(loc) => { + let index = loc.page - 1; + let height = page_heights[index]; link.action() .action_type(ActionType::GoTo) .destination_direct() - .page(page_refs[page]) - .xyz(point.x.to_f32(), height - point.y.to_f32(), None); + .page(page_refs[index]) + .xyz(loc.pos.x.to_f32(), height - loc.pos.y.to_f32(), None); } } } @@ -490,6 +490,7 @@ impl<'a> PageExporter<'a> { Element::Shape(ref shape) => self.write_shape(x, y, shape), Element::Image(id, size) => self.write_image(x, y, id, size), Element::Link(ref dest, size) => self.write_link(pos, dest, size), + Element::Pin(_) => {} } } } diff --git a/src/export/render.rs b/src/export/render.rs index aa60e67e..163707eb 100644 --- a/src/export/render.rs +++ b/src/export/render.rs @@ -62,6 +62,7 @@ fn render_frame( render_image(canvas, ts, mask, ctx.images.get(id), size); } Element::Link(_, _) => {} + Element::Pin(_) => {} } } } |
