removing some (hopefully) redundant renders

This commit is contained in:
Jesse Duffield 2021-04-02 22:32:02 +11:00
parent 77a1b96317
commit ffc8effd27

10
gui.go
View File

@ -533,10 +533,6 @@ func (g *Gui) SetManagerFunc(manager func(*Gui) error) {
// MainLoop runs the main loop until an error is returned. A successful
// finish should return ErrQuit.
func (g *Gui) MainLoop() error {
if err := g.flush(); err != nil {
return err
}
go func() {
for {
select {
@ -552,9 +548,6 @@ func (g *Gui) MainLoop() error {
Screen.EnableMouse()
}
if err := g.flush(); err != nil {
return err
}
for {
select {
case ev := <-g.gEvents:
@ -619,7 +612,8 @@ func (g *Gui) handleEvent(ev *GocuiEvent) error {
// flush updates the gui, re-drawing frames and buffers.
func (g *Gui) flush() error {
g.clear(g.FgColor, g.BgColor)
// pretty sure we don't need this, but keeping it here in case we get weird visual artifacts
// g.clear(g.FgColor, g.BgColor)
maxX, maxY := Screen.Size()
// if GUI's size has changed, we need to redraw all views