Skip to content
Permalink
Browse files

Only adjust origin-x if content size is larger than the collection vi…

…ews width (#101)
  • Loading branch information...
zenangst committed Feb 25, 2019
1 parent 75f9d1e commit f0122d310006e53cd7f3870bb982c686c4fa9519
Showing with 2 additions and 2 deletions.
  1. +2 −2 Sources/Shared/Core/BlueprintLayout.swift
@@ -394,7 +394,7 @@
// Adjust the X-origin if the content offset exceeds the width of the content size.
// This should only happen if you use section insets and have scrolled to the very end
// of the collection view.
if collectionView.contentOffset.x > contentSize.width - collectionView.frame.size.width {
if contentSize.width > collectionView.frame.size.width && collectionView.contentOffset.x > contentSize.width - collectionView.frame.size.width {
header.frame.origin.x = collectionView.contentOffset.x + sectionInset.left + sectionInset.right
}
}
@@ -422,7 +422,7 @@
// Adjust the X-origin if the content offset exceeds the width of the content size.
// This should only happen if you use section insets and have scrolled to the very end
// of the collection view.
if collectionView.contentOffset.x > contentSize.width - collectionView.frame.size.width {
if contentSize.width > collectionView.frame.size.width && collectionView.contentOffset.x > contentSize.width - collectionView.frame.size.width {
footer.frame.origin.x = collectionView.contentOffset.x + sectionInset.left + sectionInset.right
}

0 comments on commit f0122d3

Please sign in to comment.
You can’t perform that action at this time.