Whoops, fix framerate in example so it running at 60fps

This commit is contained in:
Christian Rocha 2020-01-15 16:06:14 -05:00
parent c7f1302943
commit 7f3506eedc
No known key found for this signature in database
GPG Key ID: D6CC7A16E5878018
1 changed files with 2 additions and 2 deletions

View File

@ -44,7 +44,7 @@ func tick(model tea.Model) tea.Msg {
} }
func frame(model tea.Model) tea.Msg { func frame(model tea.Model) tea.Msg {
time.Sleep(time.Second / 16) time.Sleep(time.Second / 60)
return frameMsg{} return frameMsg{}
} }
@ -115,7 +115,7 @@ func updateChosen(msg tea.Msg, m Model) (tea.Model, tea.Cmd) {
case frameMsg: case frameMsg:
if !m.Loaded { if !m.Loaded {
m.Frames += 1 m.Frames += 1
m.Progress = ease.OutBounce(float64(m.Frames) / float64(60)) m.Progress = ease.OutBounce(float64(m.Frames) / float64(120))
if m.Progress >= 1 { if m.Progress >= 1 {
m.Progress = 1 m.Progress = 1
m.Loaded = true m.Loaded = true