From 7f3506eedc959080adcc2484e7b70bdd5e50f699 Mon Sep 17 00:00:00 2001 From: Christian Rocha Date: Wed, 15 Jan 2020 16:06:14 -0500 Subject: [PATCH] Whoops, fix framerate in example so it running at 60fps --- {example => examples/views}/main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {example => examples/views}/main.go (97%) diff --git a/example/main.go b/examples/views/main.go similarity index 97% rename from example/main.go rename to examples/views/main.go index 406ea94..2572288 100644 --- a/example/main.go +++ b/examples/views/main.go @@ -44,7 +44,7 @@ func tick(model tea.Model) tea.Msg { } func frame(model tea.Model) tea.Msg { - time.Sleep(time.Second / 16) + time.Sleep(time.Second / 60) return frameMsg{} } @@ -115,7 +115,7 @@ func updateChosen(msg tea.Msg, m Model) (tea.Model, tea.Cmd) { case frameMsg: if !m.Loaded { 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 { m.Progress = 1 m.Loaded = true