bryceredd / RFQuiltLayout

A UICollectionViewLayout subclass to put items in a quilting pattern
MIT License
872 stars 130 forks source link

Fix broken logic with multiple sections #42

Open Muirey03 opened 4 years ago

Muirey03 commented 4 years ago

There is an issue with the logic in fillInBlocksToUnrestrictedRow: when using collections views with multiple sections. The for loop for rows starts row at self.lastIndexPathPlaced.row + 1, this is incorrect if section != self.lastIndexPathPlaced.section, in which case, row should start at 0.

To see a demonstration of the issue yourself, create a simple collection view with two sections, each with one item. You should see that only the item in the first section is created. This PR fixes that.