Clear and redraw screen when resizing

This commit is contained in:
Trevor Slocum 2020-02-15 07:53:48 -08:00
parent 2a8ba3160c
commit 82689e7fb8
1 changed files with 2 additions and 1 deletions

View File

@ -321,6 +321,7 @@ EventLoop:
}
}
case *tcell.EventResize:
// Throttle resize events.
if time.Since(a.lastResize) < ResizeEventThrottle {
// Stop timer
if a.throttleResize != nil && !a.throttleResize.Stop() {
@ -345,7 +346,7 @@ EventLoop:
if screen == nil {
continue
}
screen.Sync()
screen.Clear()
// Call afterResize handler if there is one.
if a.afterResize != nil {