diff --git a/crates/typst-pdf/src/krilla.rs b/crates/typst-pdf/src/krilla.rs index fabc5afef..82cc5a187 100644 --- a/crates/typst-pdf/src/krilla.rs +++ b/crates/typst-pdf/src/krilla.rs @@ -344,9 +344,9 @@ pub fn handle_shape( path_builder.line_to(l.x.to_f32(), l.y.to_f32()); } Geometry::Rect(r) => { - path_builder.push_rect( - Rect::from_xywh(0.0, 0.0, r.x.to_f32(), r.y.to_f32()).unwrap(), - ); + if let Some(r) = Rect::from_xywh(0.0, 0.0, r.x.to_f32(), r.y.to_f32()) { + path_builder.push_rect(r); + } } Geometry::Path(p) => { convert_path(p, &mut path_builder);