mirror of
https://github.com/jroimartin/gocui.git
synced 2025-04-28 13:48:51 +08:00
removing some (hopefully) redundant renders
This commit is contained in:
parent
77a1b96317
commit
ffc8effd27
10
gui.go
10
gui.go
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user