Fix list scrolling (Fix #228)

This commit is contained in:
Caleb Bassi 2019-03-01 13:28:09 -08:00
parent 1ec9fa2896
commit a8109c55df

View File

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