forked from Mirrors/bubbletea
Whoops, fix framerate in example so it running at 60fps
This commit is contained in:
parent
c7f1302943
commit
7f3506eedc
|
@ -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
|
Loading…
Reference in New Issue