forked from tslocum/cview
parent
4411a746d8
commit
81cfea205d
|
@ -3,6 +3,7 @@ v1.4.7 (WIP)
|
|||
- Add List.SetSelectedAlwaysCentered
|
||||
- Fix default background transparency of Flex and Grid
|
||||
- Fix ANSI colors 0-15
|
||||
- Fix negative List offset and DropDown selection
|
||||
|
||||
v1.4.6 (2020-05-18)
|
||||
- Add Box.ShowFocus
|
||||
|
|
8
list.go
8
list.go
|
@ -217,6 +217,10 @@ func (l *List) SetOffset(offset int) *List {
|
|||
l.Lock()
|
||||
defer l.Unlock()
|
||||
|
||||
if offset < 0 {
|
||||
offset = 0
|
||||
}
|
||||
|
||||
l.offset = offset
|
||||
return l
|
||||
}
|
||||
|
@ -690,6 +694,10 @@ func (l *List) updateOffset() {
|
|||
l.offset = len(l.items) - l.height
|
||||
}
|
||||
}
|
||||
|
||||
if l.offset < 0 {
|
||||
l.offset = 0
|
||||
}
|
||||
}
|
||||
|
||||
// Draw draws this primitive onto the screen.
|
||||
|
|
Loading…
Reference in New Issue