diff options
| author | Martin Haug <mhaug@live.de> | 2021-02-06 12:30:44 +0100 |
|---|---|---|
| committer | Martin Haug <mhaug@live.de> | 2021-02-06 12:30:44 +0100 |
| commit | 80e076814dde330fb2136172580f11e939bc6601 (patch) | |
| tree | 6cd3474ffa5e2aced38e47a7ef563ab8940612be /src/export | |
| parent | 8469bad7487e111c8e5a0ec542f0232a0ebb4bdc (diff) | |
Merge `rect` and `box` 🦚
Diffstat (limited to 'src/export')
| -rw-r--r-- | src/export/pdf.rs | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/export/pdf.rs b/src/export/pdf.rs index 7556e370..e5124c21 100644 --- a/src/export/pdf.rs +++ b/src/export/pdf.rs @@ -156,19 +156,19 @@ impl<'a> PdfExporter<'a> { c.b as f32 / 255., ); } - Fill::Image(_) => unimplemented!(), + Fill::Image(_) => todo!(), } + let x = pos.x.to_pt() as f32; + match &geometry.shape { Shape::Rect(r) => { - content.rect( - pos.x.to_pt() as f32, - (page.size.height - pos.y - r.size.height).to_pt() as f32, - r.size.width.to_pt() as f32, - r.size.height.to_pt() as f32, - false, - true, - ); + let w = r.width.to_pt() as f32; + let h = r.height.to_pt() as f32; + let y = (page.size.height - pos.y - r.height).to_pt() as f32; + if w > 0.0 && h > 0.0 { + content.rect(x, y, w, h, false, true); + } } } |
