Skip to content

Commit

Permalink
Fix content size calculation in landscape
Browse files Browse the repository at this point in the history
  • Loading branch information
ninjaprox committed Aug 27, 2015
1 parent 036de1c commit eb85314
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions NVBnbCollectionView/NVBnbCollectionViewLayout.m
Expand Up @@ -196,23 +196,23 @@ - (void)calculateContentSize {
_contentSize.height += self.headerSize.height;
_contentSize.height += (enableLoadMore) ? self.moreLoaderSize.height : 0;
} else {
if (numberOfItemsInLastGroup > 0) {
_contentSize.width += _internalGridCellSize.width + self.gridPadding;
}
if (numberOfItemsInLastGroup > 1) {
_contentSize.width += _internalGridCellSize.width + self.gridCellSpacing.width + self.gridPadding;
_contentSize.width += _internalGridCellSize.width + self.gridCellSpacing.width;
}
if (numberOfItemsInLastGroup > 3) {
_contentSize.width += _internalParallaxCellSize.width + self.gridPadding;
}
if (numberOfItemsInLastGroup > 4) {
_contentSize.width += _internalGridCellSize.width;
_contentSize.width += _internalGridCellSize.width + self.gridPadding;
}
if (numberOfItemsInLastGroup > 6) {
_contentSize.width += _internalGridCellSize.width * 2 + self.gridCellSpacing.width;
if (numberOfItemsInLastGroup > 5) {
_contentSize.width += _internalGridCellSize.width * 2 + self.gridCellSpacing.width * 2;
}
if (numberOfItemsInLastGroup > 7) {
_contentSize.width += _internalGridCellSize.width + self.gridPadding;
}
if (numberOfItemsInLastGroup > 8) {
_contentSize.width += _internalParallaxCellSize.width;
_contentSize.width += _internalGridCellSize.width + self.gridCellSpacing.width;
}
_contentSize.width += self.headerSize.width;
_contentSize.width += (enableLoadMore) ? self.moreLoaderSize.width : 0;
Expand Down

0 comments on commit eb85314

Please sign in to comment.