Start moving to mauview
This commit is contained in:
@ -18,6 +18,7 @@ package tstring
|
||||
|
||||
import (
|
||||
"github.com/mattn/go-runewidth"
|
||||
"maunium.net/go/mauview"
|
||||
|
||||
"maunium.net/go/tcell"
|
||||
)
|
||||
@ -43,7 +44,7 @@ func (cell Cell) RuneWidth() int {
|
||||
return runewidth.RuneWidth(cell.Char)
|
||||
}
|
||||
|
||||
func (cell Cell) Draw(screen tcell.Screen, x, y int) (chWidth int) {
|
||||
func (cell Cell) Draw(screen mauview.Screen, x, y int) (chWidth int) {
|
||||
chWidth = cell.RuneWidth()
|
||||
for runeWidthOffset := 0; runeWidthOffset < chWidth; runeWidthOffset++ {
|
||||
screen.SetContent(x+runeWidthOffset, y, cell.Char, nil, cell.Style)
|
||||
|
@ -21,6 +21,7 @@ import (
|
||||
"unicode"
|
||||
|
||||
"github.com/mattn/go-runewidth"
|
||||
"maunium.net/go/mauview"
|
||||
|
||||
"maunium.net/go/tcell"
|
||||
)
|
||||
@ -181,7 +182,7 @@ func (str TString) AdjustStyleFull(fn func(tcell.Style) tcell.Style) {
|
||||
str.AdjustStyle(0, len(str), fn)
|
||||
}
|
||||
|
||||
func (str TString) Draw(screen tcell.Screen, x, y int) {
|
||||
func (str TString) Draw(screen mauview.Screen, x, y int) {
|
||||
offsetX := 0
|
||||
for _, cell := range str {
|
||||
offsetX += cell.Draw(screen, x+offsetX, y)
|
||||
|
Reference in New Issue
Block a user