From: Ben Pfaff Date: Fri, 25 Apr 2025 03:02:57 +0000 (-0700) Subject: d1_pdf works X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=979b7104edb3a95ff442acdd9d6f21fd246cd26f;p=pspp d1_pdf works --- diff --git a/rust/pspp/src/output/cairo/fsm.rs b/rust/pspp/src/output/cairo/fsm.rs index 4a5ea31fbd..bb5c3544df 100644 --- a/rust/pspp/src/output/cairo/fsm.rs +++ b/rust/pspp/src/output/cairo/fsm.rs @@ -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 { diff --git a/rust/pspp/src/output/pivot/test.rs b/rust/pspp/src/output/pivot/test.rs index ad022a5554..33c5f29f5f 100644 --- a/rust/pspp/src/output/pivot/test.rs +++ b/rust/pspp/src/output/pivot/test.rs @@ -62,6 +62,7 @@ Columns ); } +#[test] fn d1_pdf() { let pt = d1("Columns", Axis3::X); let mut cairo = CairoDriver::new("d1.pdf");