Fix list scrolling (Fix #228)

This commit is contained in:
Caleb Bassi 2019-03-01 13:28:09 -08:00
parent 1ec9fa2896
commit a8109c55df
1 changed files with 3 additions and 2 deletions

View File

@ -35,8 +35,9 @@ func (self *List) Draw(buf *Buffer) {
point := self.Inner.Min
if self.SelectedRow >= self.Inner.Max.Y+self.topRow-2 {
self.topRow = self.SelectedRow - self.Inner.Max.Y + 2
// adjusts view into widget
if self.SelectedRow >= self.Inner.Dy()+self.topRow {
self.topRow = self.SelectedRow - self.Inner.Dy() + 1
} else if self.SelectedRow < self.topRow {
self.topRow = self.SelectedRow
}