Skip to content

Commit

Permalink
fix(progress): update progress bar threshold method per changes in d8…
Browse files Browse the repository at this point in the history
  • Loading branch information
meowgorithm committed Mar 31, 2022
1 parent 00d61de commit 6d6149c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions progress/progress.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,8 @@ func (m Model) Percent() float64 {
// If you're rendering with ViewAs you won't need this.
func (m *Model) SetPercent(p float64) tea.Cmd {
// If the value is at or below the animation threshold, don't animate
if math.Abs(p-m.percent) <= m.animThreshold {
m.percent = asRatio(p)
if math.Abs(p-m.percentShown) <= m.animThreshold {
m.percentShown = asRatio(p)
m.targetPercent = asRatio(p)
return nil
}
Expand Down

0 comments on commit 6d6149c

Please sign in to comment.