Skip to content
This repository has been archived by the owner on Dec 22, 2023. It is now read-only.

Commit

Permalink
Fix header & footer x origin when reaching the end (#112)
Browse files Browse the repository at this point in the history
Removes the previous fixes that was suppose to align the headers and footers
correctly when reaching the end of a collection view. It appears that the
previous fix was faulty and is now removed.
  • Loading branch information
zenangst authored Jun 13, 2019
1 parent 2813f4c commit 2ff1330
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 15 deletions.
2 changes: 1 addition & 1 deletion Blueprints.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|
s.name = "Blueprints"
s.summary = "A collection of flow layouts that is meant to make your life easier."
s.version = "0.11.2"
s.version = "0.11.3"
s.homepage = "https://github.com/zenangst/Blueprints"
s.license = 'MIT'
s.author = { "Christoffer Winterkvist" => "[email protected]" }
Expand Down
14 changes: 0 additions & 14 deletions Sources/Shared/Core/BlueprintLayout.swift
Original file line number Diff line number Diff line change
Expand Up @@ -398,13 +398,6 @@
}
case .horizontal:
header.frame.origin.x = min(max(collectionView.contentOffset.x, header.min), header.max - header.frame.size.width)

// 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 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
}
@unknown default:
fatalError("Case not implemented in current implementation")
}
Expand All @@ -431,13 +424,6 @@
fatalError("Case not implemented in current implementation")
}

// 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 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
}

if let invalidationContext = context as? BlueprintInvalidationContext {
#if os(macOS)
invalidationContext.footerIndexPaths += [footer.indexPath!]
Expand Down

0 comments on commit 2ff1330

Please sign in to comment.