mirror of
https://github.com/Maks1mS/bubbles.git
synced 2024-12-24 14:44:38 +03:00
fix(progress): update progress bar threshold method per changes in d897463
This commit is contained in:
parent
00d61decf4
commit
6d6149cea8
@ -251,8 +251,8 @@ func (m Model) Percent() float64 {
|
|||||||
// If you're rendering with ViewAs you won't need this.
|
// If you're rendering with ViewAs you won't need this.
|
||||||
func (m *Model) SetPercent(p float64) tea.Cmd {
|
func (m *Model) SetPercent(p float64) tea.Cmd {
|
||||||
// If the value is at or below the animation threshold, don't animate
|
// If the value is at or below the animation threshold, don't animate
|
||||||
if math.Abs(p-m.percent) <= m.animThreshold {
|
if math.Abs(p-m.percentShown) <= m.animThreshold {
|
||||||
m.percent = asRatio(p)
|
m.percentShown = asRatio(p)
|
||||||
m.targetPercent = asRatio(p)
|
m.targetPercent = asRatio(p)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user