From 226c5aaee79fa49e4732e9c4cc788ae1dc20f6eb Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Mon, 1 Dec 2025 08:57:18 -0800 Subject: [PATCH] Revert "work" This reverts commit 8c619b5d09368c47c7560a7f63fac15c1d08e6ad. --- rust/pspp/src/output/render.rs | 36 ++++++++++------------------------ 1 file changed, 10 insertions(+), 26 deletions(-) diff --git a/rust/pspp/src/output/render.rs b/rust/pspp/src/output/render.rs index 25e40a56db..9b4d71cc57 100644 --- a/rust/pspp/src/output/render.rs +++ b/rust/pspp/src/output/render.rs @@ -686,7 +686,6 @@ impl Page { pixel0: usize, pixel1: usize, ) -> Arc { - dbg!((a, &extent, pixel0, pixel1)); let b = !a; let z0 = extent.start; let z1 = extent.end; @@ -757,10 +756,8 @@ impl Page { p0: pixel0, p1: pixel1, }; - // Add overflows along the left side... if self.h[a] == 0 || z0 > self.h[a] || pixel0 > 0 { - dbg!(); let mut z = 0; while z < self.n[b] { let d = Coord2::for_axis((a, z0), z); @@ -1177,7 +1174,6 @@ impl Break { let mut size = self .page .axis_width(self.axis, 0..rule_ofs(self.page.h[self.axis])); - dbg!(size); // If we have a pixel offset and there is no header, then we omit // the leftmost rule of the body. Otherwise the rendering is deceptive @@ -1189,28 +1185,24 @@ impl Break { // assume that the width of a merged rule is the larger of the widths of // either rule individually. if self.pixel == 0 || self.page.h[self.axis] > 0 { - size += dbg!(max( + size += max( self.page.rule_width(self.axis, self.page.h[self.axis]), self.page.rule_width(self.axis, self.z), - )); + ); } // Width of body, minus any pixel offset in the leftmost cell. - dbg!(self.z..cell); - dbg!(&self.page.cp[self.axis]); - size += dbg!( - self.page - .joined_width(self.axis, self.z..cell) - .strict_sub(self.pixel) - ); + size += self + .page + .joined_width(self.axis, self.z..cell) + .checked_sub(self.pixel) + .unwrap(); // Width of rightmost rule in body merged with leftmost rule in headers. - size += dbg!(max( + size += max( self.page.rule_width_r(self.axis, 0), self.page.rule_width(self.axis, cell), - )); - - dbg!((cell, size)); + ); size } @@ -1225,10 +1217,7 @@ impl Break { return None; } - dbg!(&self.page); - dbg!(&self.page.cp[self.axis]); - dbg!((self.axis, self.z, size)); - dbg!(self.find_breakpoint(device, size)).map(|(z, pixel)| { + self.find_breakpoint(device, size).map(|(z, pixel)| { let page = match pixel { 0 => self.page.select(self.axis, self.z..z, self.pixel, 0), pixel => self.page.select( @@ -1246,7 +1235,6 @@ impl Break { fn break_cell(&self, device: &dyn Device, z: usize, overflow: usize) -> usize { if self.cell_is_breakable(device, z) { - dbg!(z); // If there is no right header and we render a partial cell // on the right side of the body, then we omit the rightmost // rule of the body. Otherwise the rendering is deceptive @@ -1345,10 +1333,6 @@ impl Break { /// This is just a heuristic. Breaking cells across page boundaries can /// save space, but it looks ugly. fn cell_is_breakable(&self, device: &dyn Device, cell: usize) -> bool { - dbg!(( - self.page.cell_width(self.axis, cell), - device.params().min_break[self.axis] - )); self.page.cell_width(self.axis, cell) >= device.params().min_break[self.axis] } } -- 2.30.2