From: Ben Pfaff Date: Fri, 26 Dec 2025 00:39:43 +0000 (-0800) Subject: Fix margins X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0d87faef96dae5fd73ddd1c189e78ce9f9b1dd8b;p=pspp Fix margins --- diff --git a/rust/pspp/src/output/drivers/cairo/fsm.rs b/rust/pspp/src/output/drivers/cairo/fsm.rs index 786c1a3c9e..9567e25792 100644 --- a/rust/pspp/src/output/drivers/cairo/fsm.rs +++ b/rust/pspp/src/output/drivers/cairo/fsm.rs @@ -544,7 +544,7 @@ impl Device for CairoDevice<'_> { fn measure_cell_height(&self, cell: &DrawCell, width: isize) -> isize { let margins = &cell.cell_style.margins; let bb = Rect2::new( - 0..width.saturating_sub(px_to_xr(margins[Axis2::X].len() as isize)), + 0..width.saturating_sub(margin(cell, Axis2::X)), 0..isize::MAX, ); self.measure_cell(cell, bb).y() + margin(cell, Axis2::Y) diff --git a/rust/pspp/src/output/pivot/value.rs b/rust/pspp/src/output/pivot/value.rs index 9127658e66..1f37966f31 100644 --- a/rust/pspp/src/output/pivot/value.rs +++ b/rust/pspp/src/output/pivot/value.rs @@ -272,6 +272,7 @@ impl Value { self } + /// Returns this `Value` with the added `footnotes`. pub fn with_footnotes<'a>( mut self, footnotes: impl IntoIterator>, @@ -289,6 +290,7 @@ impl Value { footnotes.sort_by_key(|f| f.index); } + /// Returns this `Value` with the added `subscripts`. pub fn with_subscripts<'a>( mut self, subscripts: impl IntoIterator>, @@ -299,11 +301,13 @@ impl Value { self } + /// Returns this `Value` with the added `subscript`. pub fn with_subscript(mut self, subscript: impl Into) -> Self { self.add_subscript(subscript); self } + /// Adds `subscript` to this `Value`. pub fn add_subscript(&mut self, subscript: impl Into) { self.styling_mut().subscripts.push(subscript.into()); } @@ -1202,6 +1206,8 @@ impl ValueInner { } } + /// Constructs a new text `ValueInner` from `s`, which should have been + /// provided by the user. pub fn new_user_text(s: impl Into) -> Self { let s: String = s.into(); if !s.is_empty() {