summaryrefslogtreecommitdiff
path: root/src/export/pdf.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2019-10-11 20:28:22 +0200
committerLaurenz <laurmaedje@gmail.com>2019-10-11 20:28:22 +0200
commit6f22e4f13c42f06b686a01fbdd28a0163e88ae77 (patch)
treea78145f5f9d84325529a8529875c9ef6ca5b9a1a /src/export/pdf.rs
parentc0e4fd55e6fa738cfc5dcc851d0fc3ee2d0f2cd2 (diff)
Render debug boxes 🧭
Diffstat (limited to 'src/export/pdf.rs')
-rw-r--r--src/export/pdf.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/export/pdf.rs b/src/export/pdf.rs
index d601f6b3..3a3f2a9c 100644
--- a/src/export/pdf.rs
+++ b/src/export/pdf.rs
@@ -14,7 +14,8 @@ use toddle::font::OwnedFont;
use toddle::query::SharedFontLoader;
use toddle::Error as FontError;
-use crate::doc::{Document, Page as DocPage, LayoutAction};
+use crate::layout::LayoutAction;
+use crate::doc::{Document, Page as DocPage};
use crate::size::{Size, Size2D};
@@ -192,16 +193,16 @@ impl<'d, W: Write> PdfEngine<'d, W> {
}
// Flush the position.
- if let Some(pos) = next_pos {
+ if let Some(pos) = next_pos.take() {
let x = pos.x.to_pt();
let y = (page.height - pos.y - Size::pt(active_font.1)).to_pt();
text.tm(1.0, 0.0, 0.0, 1.0, x, y);
- next_pos = None;
}
// Write the text.
text.tj(self.fonts[active_font.0].encode_text(&string)?);
},
+ LayoutAction::DebugBox(_, _) => {},
}
}