Skip to content

Commit

Permalink
Update list.go (#1508)
Browse files Browse the repository at this point in the history
This min value is equal to -1 when minimized.  and line 192 panic: runtime error: index out of range [-1]
  • Loading branch information
ruanwenfeng committed Nov 5, 2020
1 parent 56fdd27 commit 0ca05dc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion widget/list.go
Expand Up @@ -182,7 +182,7 @@ func (l *listRenderer) Layout(size fyne.Size) {

// Relayout What Is Visible - no scroll change - initial layout or possibly from a resize.
l.visibleItemCount = int(math.Ceil(float64(l.scroller.size.Height) / float64(l.list.itemMin.Height+listDividerHeight)))
if l.visibleItemCount == 0 {
if l.visibleItemCount <= 0 {
return
}
min := int(math.Min(float64(length), float64(l.visibleItemCount)))
Expand Down

0 comments on commit 0ca05dc

Please sign in to comment.