From d624db30c6ff5fc7acbc98f0db8bb26fdc66adbc Mon Sep 17 00:00:00 2001 From: Qwerasd Date: Sun, 22 Dec 2024 12:38:17 -0500 Subject: [PATCH] test(metrics): fix to initialize cursor height + add comment --- src/font/face/Metrics.zig | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/font/face/Metrics.zig b/src/font/face/Metrics.zig index 2ee563bf7..7bc456629 100644 --- a/src/font/face/Metrics.zig +++ b/src/font/face/Metrics.zig @@ -444,11 +444,13 @@ test "Metrics: adjust cell height smaller" { m.underline_position = 55; m.strikethrough_position = 30; m.cell_height = 100; + m.cursor_height = 100; m.apply(set); try testing.expectEqual(@as(u32, 50), m.cell_height); try testing.expectEqual(@as(u32, 25), m.cell_baseline); try testing.expectEqual(@as(u32, 30), m.underline_position); try testing.expectEqual(@as(u32, 5), m.strikethrough_position); + // Cursor height is separate from cell height and does not follow it. try testing.expectEqual(@as(u32, 100), m.cursor_height); } @@ -465,11 +467,13 @@ test "Metrics: adjust cell height larger" { m.underline_position = 55; m.strikethrough_position = 30; m.cell_height = 100; + m.cursor_height = 100; m.apply(set); try testing.expectEqual(@as(u32, 200), m.cell_height); try testing.expectEqual(@as(u32, 100), m.cell_baseline); try testing.expectEqual(@as(u32, 105), m.underline_position); try testing.expectEqual(@as(u32, 80), m.strikethrough_position); + // Cursor height is separate from cell height and does not follow it. try testing.expectEqual(@as(u32, 100), m.cursor_height); }