1
0
mirror of https://github.com/taigrr/gopher-os synced 2025-01-18 04:43:13 -08:00

Change Dimensions() signature to support querying for characters or pixels

This commit is contained in:
Achilleas Anagnostopoulos
2017-07-09 17:50:50 +01:00
parent 952d0bf4a5
commit cbf0c82702
5 changed files with 38 additions and 10 deletions

View File

@@ -61,7 +61,7 @@ func (t *VT) AttachTo(cons console.Device) {
}
t.cons = cons
t.viewportWidth, t.viewportHeight = cons.Dimensions()
t.viewportWidth, t.viewportHeight = cons.Dimensions(console.Characters)
t.viewportY = 0
t.defaultFg, t.defaultBg = cons.DefaultColors()
t.curFg, t.curBg = t.defaultFg, t.defaultBg

View File

@@ -366,7 +366,7 @@ func newMockConsole(w, h uint32) *mockConsole {
}
}
func (cons *mockConsole) Dimensions() (uint32, uint32) {
func (cons *mockConsole) Dimensions(_ console.Dimension) (uint32, uint32) {
return cons.width, cons.height
}