Skip to content

Commit

Permalink
Update flow.go
Browse files Browse the repository at this point in the history
  • Loading branch information
maxence-charriere committed Jun 29, 2021
1 parent fa270f6 commit 3bc410f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/ui/flow.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,10 @@ func (f *flow) refresh(ctx app.Context) {
itemsPerRow = 1
}
itemWidthFloat := float64(w-f.Ispacing*itemsPerRow) / float64(itemsPerRow)
if itemWidthFloat == 0 {
ctx.Dispatch(f.refresh)
return
}

if itemsPerRow != f.itemsPerRow || itemWidthFloat != f.itemWidth {
f.itemsPerRow = itemsPerRow
Expand Down

0 comments on commit 3bc410f

Please sign in to comment.