mirror of
https://github.com/Maks1mS/bubbles.git
synced 2025-01-11 14:38:10 +03:00
Correct scroll percentage reporting
This commit is contained in:
parent
3c07b97d37
commit
5720cfb35a
@ -65,7 +65,7 @@ func (m Model) ScrollPercent() float64 {
|
||||
}
|
||||
y := float64(m.YOffset)
|
||||
h := float64(m.Height)
|
||||
t := float64(len(m.lines))
|
||||
t := float64(len(m.lines) - 1)
|
||||
v := y / (t - h)
|
||||
return math.Max(0.0, math.Min(1.0, v))
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user