Skip to content

Commit

Permalink
test(metrics): fix to initialize cursor height + add comment
Browse files Browse the repository at this point in the history
  • Loading branch information
qwerasd205 committed Dec 22, 2024
1 parent 08ebb6b commit d624db3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/font/face/Metrics.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand All @@ -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);
}

Expand Down

0 comments on commit d624db3

Please sign in to comment.