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 16e054d
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions scripts/update-svgs.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,12 @@ function layoutItems(items, data, y) {
while (i < items.length) {
const item = items[i]
const image = item.image
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
if (image) {
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
Expand Down

0 comments on commit 16e054d

Please sign in to comment.