Scrolling performance - redraw old quotes.

Rather than fetching quotes each time we need to redraw them becuase the
user has scrolled the screen, just redraw the old quotes.
master
root 3 years ago
parent 09551a6e71
commit 7090a2c0d5
  1. 2
      cmd/mop/main.go
  2. 6
      screen.go

@ -168,7 +168,7 @@ loop:
}
if redrawQuotesFlag && len(keyboardQueue) == 0 {
screen.Draw(quotes)
screen.DrawOldQuotes(quotes)
redrawQuotesFlag = false
}
}

@ -119,6 +119,12 @@ func (screen *Screen) ScrollBottom(max int) {
}
}
func (screen *Screen) DrawOldQuotes(quotes *Quotes) {
screen.draw(screen.layout.Quotes(quotes), true)
termbox.Flush()
}
// Draw accepts variable number of arguments and knows how to display the
// market data, stock quotes, current time, and an arbitrary string.
func (screen *Screen) Draw(objects ...interface{}) *Screen {

Loading…
Cancel
Save