From 6adec369ef37ba8af29d76ab1d1e2b56a4a78c19 Mon Sep 17 00:00:00 2001 From: nick black Date: Thu, 23 Jan 2025 12:17:57 -0500 Subject: [PATCH] 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. --- src/font/sprite/Box.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/font/sprite/Box.zig b/src/font/sprite/Box.zig index ba7caa26a..b72df8a89 100644 --- a/src/font/sprite/Box.zig +++ b/src/font/sprite/Box.zig @@ -2495,7 +2495,7 @@ fn yThirds(self: Box) [2]u32 { return switch (@mod(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 }, - 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, }; }