d1_pdf works
authorBen Pfaff <blp@cs.stanford.edu>
Fri, 25 Apr 2025 03:02:57 +0000 (20:02 -0700)
committerBen Pfaff <blp@cs.stanford.edu>
Fri, 25 Apr 2025 03:02:57 +0000 (20:02 -0700)
rust/pspp/src/output/cairo/fsm.rs
rust/pspp/src/output/pivot/test.rs

index 4a5ea31fbd484b5d9153ccf9bb6469e9e8f56bef..bb5c3544df300d0b8999d12326c1f6e19eb5db91 100644 (file)
@@ -225,7 +225,7 @@ fn xr_fill_rectangle(context: &Context, rectangle: Rect2) {
     let width = xr_to_pt(rectangle[Axis2::X].len());
     let height = xr_to_pt(rectangle[Axis2::Y].len());
     context.rectangle(x0, y0, width, height);
-    let _ = context.fill();
+    context.fill().unwrap();
 }
 
 fn margin(cell: &DrawCell, axis: Axis2) -> usize {
@@ -471,11 +471,11 @@ impl CairoDevice<'_> {
         color: Color,
     ) {
         self.context.new_path();
-        self.context.set_line_width(match stroke {
+        self.context.set_line_width(xr_to_pt(match stroke {
             Stroke::Thick => LINE_WIDTH * 2,
             Stroke::Thin => LINE_WIDTH / 2,
             _ => LINE_WIDTH,
-        } as f64);
+        }) as f64);
         self.context.move_to(xr_to_pt(x0), xr_to_pt(y0));
         self.context.line_to(xr_to_pt(x1), xr_to_pt(y1));
         if !self.style.use_system_colors {
index ad022a55549d8dc65310db5cbb3f67747e3d74ea..33c5f29f5f5562279ae1419efa001705b8e2a78f 100644 (file)
@@ -62,6 +62,7 @@ Columns
     );
 }
 
+#[test]
 fn d1_pdf() {
     let pt = d1("Columns", Axis3::X);
     let mut cairo = CairoDriver::new("d1.pdf");