pixel0: usize,
pixel1: usize,
) -> Arc<Self> {
- dbg!((a, &extent, pixel0, pixel1));
let b = !a;
let z0 = extent.start;
let z1 = extent.end;
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);
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
// 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
}
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(
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
/// 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]
}
}