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
@@ -78,3 +78,20 @@ func TestKbdSnapshot(t *testing.T) {
})
})
}
func TestKbdTextScale(t *testing.T) {
var h [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() {
h[i] = Kbd(c, "Mod", "K").Bounds().H
})
}, 400, 200)
tt.SetPreferences(ui.Preferences{TextScale: s})
tt.Frame()
}
if h[1] < h[0]*1.5 {
t.Fatalf("height %v at 2x, %v at 1x", h[1], h[0])
}
}