Fix panic on resize

This commit is contained in:
Caleb Bassi 2019-02-06 02:11:41 -08:00
parent e8f77eef12
commit ee3c96bc97

View File

@ -300,11 +300,11 @@ func eventLoop() {
payload := e.Payload.(ui.Resize)
if statusbar {
grid.SetRect(0, 0, payload.Width, payload.Height-1)
bar.SetRect(0, payload.Height-1, payload.Width, payload.Height)
} else {
grid.SetRect(0, 0, payload.Width, payload.Height)
}
help.Resize(payload.Width, payload.Height)
bar.SetRect(0, payload.Height-1, payload.Width, payload.Height)
ui.Clear()
}
@ -337,7 +337,9 @@ func eventLoop() {
}
case "<Resize>":
render(grid)
render(bar)
if statusbar {
render(bar)
}
case "<MouseLeft>":
payload := e.Payload.(ui.Mouse)
proc.Click(payload.X, payload.Y)