Browse Source

Fix negative List offset and DropDown selection

Resolves #16.
merge-requests/4/head
Trevor Slocum 2 years ago
parent
commit
81cfea205d
  1. 1
      CHANGELOG
  2. 8
      list.go

1
CHANGELOG

@ -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

@ -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…
Cancel
Save