Skip to content

Commit db88e90

Browse files
committed
Test macos pixel density test fix
1 parent c4352e9 commit db88e90

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

src/engine.zig

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3609,6 +3609,7 @@ test "button sizing" {
36093609

36103610
const not_quite_one_line = default_font_size * 2 - 5;
36113611
const not_quite_two_lines = default_font_size * 2 - 5;
3612+
36123613
var button = try panel.add(allocator, display, .{
36133614
.visible = .visible,
36143615
.rect = .{ .width = 50, .height = 50 },
@@ -3655,8 +3656,16 @@ test "button sizing" {
36553656
display.relayout();
36563657
try eq(42, @round(button.rect.width / display.pixel_density));
36573658
try eq(100, @round(panel.rect.width));
3658-
try eq(default_font_size, button.rect.height / display.pixel_density);
3659+
try eq(not_quite_two_lines, button.rect.height / display.pixel_density);
36593660
try eq(0, panel.rect.height);
3661+
3662+
try button.set_text(allocator, display, "Hello Defragment");
3663+
display.relayout();
3664+
try eq(default_font_size * 2, button.rect.height / display.pixel_density);
3665+
panel.pad.top = 4;
3666+
panel.pad.bottom = 5;
3667+
display.relayout();
3668+
try eq(default_font_size * 2 + 4 + 5, button.rect.height / display.pixel_density);
36603669
}
36613670

36623671
test "text input sizing" {

0 commit comments

Comments
 (0)