From 4a85021c65f99f0acdc6200260490caa2e77c838 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Mon, 1 Dec 2025 08:56:18 -0800 Subject: [PATCH] work --- rust/pspp/src/output/drivers/text.rs | 5 ++++- rust/pspp/src/output/render.rs | 14 ++++++++------ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/rust/pspp/src/output/drivers/text.rs b/rust/pspp/src/output/drivers/text.rs index 65757b220f..9b18ac44ad 100644 --- a/rust/pspp/src/output/drivers/text.rs +++ b/rust/pspp/src/output/drivers/text.rs @@ -119,7 +119,10 @@ impl TextRenderer { font_size: EnumMap::from_fn(|_| 1), line_widths: EnumMap::from_fn(|stroke| if stroke == Stroke::None { 0 } else { 1 }), px_size: None, - min_break: EnumMap::default(), + min_break: enum_map! { + Axis2::X => width / 2, + Axis2::Y => usize::MAX, + }, supports_margins: false, rtl: false, printing: true, diff --git a/rust/pspp/src/output/render.rs b/rust/pspp/src/output/render.rs index a37618b83e..9b4d71cc57 100644 --- a/rust/pspp/src/output/render.rs +++ b/rust/pspp/src/output/render.rs @@ -669,13 +669,13 @@ impl Page { /// Creates and returns a new [Page] whose contents are a subregion of this /// page's contents. The new page includes cells `extent` (exclusive) along - /// `axis`, plus any headers on `axis`. + /// axis `a`, plus any headers on `a`. /// /// If `pixel0` is nonzero, then it is a number of pixels to exclude from - /// the left or top (according to `axis`) of cell `extent.start`. - /// Similarly, `pixel1` is a number of pixels to exclude from the right or - /// bottom of cell `extent.end - 1`. (`pixel0` and `pixel1` are used to - /// render cells that are too large to fit on a single page.) + /// the left or top (according to `a`) of cell `extent.start`. Similarly, + /// `pixel1` is a number of pixels to exclude from the right or bottom of + /// cell `extent.end - 1`. (`pixel0` and `pixel1` are used to render cells + /// that are too large to fit on a single page.) /// /// The whole of axis `!axis` is included. (The caller may follow up with /// another call to select on `!axis`.) @@ -756,6 +756,7 @@ impl Page { p0: pixel0, p1: pixel1, }; + // Add overflows along the left side... if self.h[a] == 0 || z0 > self.h[a] || pixel0 > 0 { let mut z = 0; while z < self.n[b] { @@ -783,13 +784,14 @@ impl Page { } } + // Add overflows along the right side. let mut z = 0; while z < self.n[b] { let d = Coord2::for_axis((a, z1 - 1), z); let cell = self.get_cell(d); if cell.rect[a].end > z1 || (cell.rect[a].end == z1 && pixel1 > 0) - && overflows.contains_key(&s.coord_to_subpage(cell.rect.top_left())) + && !overflows.contains_key(&s.coord_to_subpage(cell.rect.top_left())) { let mut overflow = self.overflows.get(&d).cloned().unwrap_or_default(); overflow[a][1] += -- 2.30.2