Skip to content

Commit

Permalink
Skip incomplete avatars when laying out images
Browse files Browse the repository at this point in the history
  • Loading branch information
dcodeIO committed Mar 25, 2022
1 parent 3019b5e commit 107bf34
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/update-svgs.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,13 +129,13 @@ function layoutItems(items, data, y) {
const rowItems = []
let w = 0
while (i < items.length) {
const item = items[i]
const item = items[i++]
const image = item.image
if (!image) continue
const newW = w + image.width + (w > 0 ? margin(image.height) : 0)
if (newW >= WIDTH - 20) break // leave a little space around
rowItems.push(item)
w = newW
++i
}
x = (WIDTH - w) >>> 1
row(rowItems)
Expand Down

0 comments on commit 107bf34

Please sign in to comment.