From 7218892c722ca583297c0ebbda350bdf6f16d3ce Mon Sep 17 00:00:00 2001 From: Laurenz Date: Tue, 1 Jun 2021 12:46:01 +0200 Subject: Refactor path handling --- src/export/pdf.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/export') diff --git a/src/export/pdf.rs b/src/export/pdf.rs index 0ca4df38..1cc62332 100644 --- a/src/export/pdf.rs +++ b/src/export/pdf.rs @@ -139,7 +139,7 @@ impl<'a> PdfExporter<'a> { // We only write font switching actions when the used face changes. To // do that, we need to remember the active face. - let mut face = FaceId::MAX; + let mut face = None; let mut size = Length::zero(); let mut fill: Option = None; @@ -158,8 +158,8 @@ impl<'a> PdfExporter<'a> { // Then, also check if we need to issue a font switching // action. - if shaped.face_id != face || shaped.size != size { - face = shaped.face_id; + if face != Some(shaped.face_id) || shaped.size != size { + face = Some(shaped.face_id); size = shaped.size; let name = format!("F{}", self.fonts.map(shaped.face_id)); -- cgit v1.2.3