File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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
36623671test "text input sizing" {
You can’t perform that action at this time.
0 commit comments