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,
/// 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`.)
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] {
}
}
+ // 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] +=