mirror of
https://github.com/Maks1mS/bubbles.git
synced 2025-03-14 13:03:44 +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)
|
y := float64(m.YOffset)
|
||||||
h := float64(m.Height)
|
h := float64(m.Height)
|
||||||
t := float64(len(m.lines))
|
t := float64(len(m.lines) - 1)
|
||||||
v := y / (t - h)
|
v := y / (t - h)
|
||||||
return math.Max(0.0, math.Min(1.0, v))
|
return math.Max(0.0, math.Min(1.0, v))
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user