A few fixes
This commit is contained in:
@@ -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++
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user