sextants: always properly scale the middle

what's going on here is we're saying if there's a
single extra row in the cell to be distributed,
put it on the center, and if there are two, put them
on the top and bottom (we get the bottom without
specification because we use the cell geometry
directly there). in the mod 2 case, we still want
to draw the middle one line past its natural position,
to account for the extra line from above. otherwise
your bottom third is one larger than your top, and
two larger than your middle, which no one wants.
This commit is contained in:
nick black
2025-01-23 12:17:57 -05:00
parent ddf7173ae9
commit 6adec369ef

View File

@ -2495,7 +2495,7 @@ fn yThirds(self: Box) [2]u32 {
return switch (@mod(self.metrics.cell_height, 3)) { return switch (@mod(self.metrics.cell_height, 3)) {
0 => .{ self.metrics.cell_height / 3, 2 * self.metrics.cell_height / 3 }, 0 => .{ self.metrics.cell_height / 3, 2 * self.metrics.cell_height / 3 },
1 => .{ self.metrics.cell_height / 3, 2 * self.metrics.cell_height / 3 + 1 }, 1 => .{ self.metrics.cell_height / 3, 2 * self.metrics.cell_height / 3 + 1 },
2 => .{ self.metrics.cell_height / 3 + 1, 2 * self.metrics.cell_height / 3 }, 2 => .{ self.metrics.cell_height / 3 + 1, 2 * self.metrics.cell_height / 3 + 1 },
else => unreachable, else => unreachable,
}; };
} }