Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
deguchi committed Apr 8, 2022
1 parent 1b026d9 commit d808b36
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Hiradumi.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ const Hiradumi = (props: Props) => {

const rowMaxWidth = props.width - props.padding * 2 - getScrollbarWidth()
for (let i = 0; itemsInProcess.length > 0 && rows.length <= props.rowCount; i++) {

const rowRatioIndex = i % props.rowRatios.length
const rowRatio = props.rowRatios[rowRatioIndex]

Expand Down Expand Up @@ -255,7 +254,9 @@ const putItem = (currentItems: any[], rowWidth: number, rowRatio: number, itemHe
const aspect: number = hasAspect ? item.properties.aspect : 0.666666
const width = Math.floor(height * aspect) + itemMargin
// 行よりも大きくなるなら終了
if (rowTotalWidth + width > rowWidth) return true
if (rowTotalWidth + width > rowWidth) {
if (items.length > 0) return true
}
item.height = height
item.width = width
items.push(item)
Expand Down

0 comments on commit d808b36

Please sign in to comment.