Simplify header height check in layout

Summary:
Issue fixed: #

- [ ] All tests pass. Demo project builds and runs.
- [ ] I added tests, an experiment, or detailed why my change isn't tested.
- [ ] I added an entry to the `CHANGELOG.md` for any breaking changes, enhancements, or bug fixes.
- [ ] I have reviewed the [contributing guide](https://github.com/Instagram/IGListKit/blob/master/.github/CONTRIBUTING.md)

Small changes
Closes https://github.com/Instagram/IGListKit/pull/565

Differential Revision: D4728939

Pulled By: rnystrom

fbshipit-source-id: 4f0c3455f55d4c267dffe5d7ebd37a96a648ec52
This commit is contained in:
PhilCai 2017-03-17 08:07:37 -07:00 committed by Facebook Github Bot
parent 15f3c4b828
commit bbd4738ca2

View file

@ -139,10 +139,8 @@ static void adjustZIndexForAttributes(UICollectionViewLayoutAttributes *attribut
// do not add zero height headers or headers that are outside the rect
const CGRect frame = attributes.frame;
const CGRect intersection = CGRectIntersection(frame, rect);
if (!CGRectIsEmpty(intersection) || CGRectGetHeight(frame) == 0.0) {
if (CGRectGetHeight(frame) > 0.0) {
[result addObject:attributes];
}
if (!CGRectIsEmpty(intersection) && CGRectGetHeight(frame) > 0.0) {
[result addObject:attributes];
}
}