Display: review r1 fixes

This commit is contained in:
ZacharyZhang-NY committed 2026-10-05 12:31:17 -04:00
1 parent 2a232930dd
commit 822e7a673a
31 files changed
+409 -156

No files matched your search

+17
View File
@@ -112,3 +112,20 @@ func TestBadgeSnapshot(t *testing.T) {
})
})
}
func TestBadgeTextScale(t *testing.T) {
var w [2]float32
for i, s := range []float32{1, 2} {
tt := ui.NewTester(func(c *ui.Context) {
Use(c, Settings{})
ui.Row(c).AlignItems(ui.Start).Children(func() {
w[i] = Badge(c, BadgeOptions{Text: "Draft"}, nil).Bounds().W
})
}, 400, 200)
tt.SetPreferences(ui.Preferences{TextScale: s})
tt.Frame()
}
if w[1] < w[0]*1.5 {
t.Fatalf("width %v at 2x, %v at 1x", w[1], w[0])
}
}