A few fixes

This commit is contained in:
2025-08-18 15:49:03 -05:00
parent 061bf1b37d
commit 599554a798
7 changed files with 117 additions and 117 deletions

View File

@@ -58,8 +58,6 @@ func (w *Text) Init(id string, style tcell.Style) {
func (w *Text) Id() string { return w.id }
func (w *Text) HandleResize(ev *tcell.EventResize) {
w.w, w.h = ev.Size()
// w.w = wh.Min(w.w, w.WantW())
// w.h = wh.Min(w.h, w.WantH())
}
func (w *Text) HandleKey(ev *tcell.EventKey) bool { return false }
func (w *Text) HandleTime(ev *tcell.EventTime) {}
@@ -69,7 +67,7 @@ func (w *Text) Draw(screen tcell.Screen) {
}
y := w.y
for i := range w.message {
wh.DrawText(w.x-(len(w.message[i])/2), y, w.message[i], w.style, screen)
wh.DrawText(w.x+(w.w/2)-(len(w.message[i])/2), y, w.message[i], w.style, screen)
y++
}
}