Fix panic

This commit is contained in:
Laurenz Stampfl 2024-12-14 22:42:44 +01:00
parent 01fd27c747
commit 24087db62f

View File

@ -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);