A resize event should have the screen cleared before redrawing. Fixes #19

This commit is contained in:
Oliver 2018-01-13 12:43:12 +01:00
parent cc7bb29944
commit 4153189e1b
1 changed files with 5 additions and 4 deletions

View File

@ -166,13 +166,14 @@ func (a *Application) Run() error {
}
}
case *tcell.EventResize:
a.Lock()
screen := a.screen
if a.rootAutoSize && a.root != nil {
a.Lock()
width, height := a.screen.Size()
width, height := screen.Size()
a.root.SetRect(0, 0, width, height)
a.Unlock()
a.Draw()
}
a.Unlock()
screen.Clear()
a.Draw()
}
}