mirror of
https://github.com/Instagram/IGListKit
synced 2026-05-23 09:18:29 +00:00
fix a bug which caused double inset being applied when having non-zero left contentInset.
Summary: [IGListCollectionViewLayout]: fix a bug which caused double inset being applied when having non-zero left contentInset. Reviewed By: jessesquires Differential Revision: D4692870 fbshipit-source-id: 1a1a3ccf944a83fea3a706b83f54293346b35c5a
This commit is contained in:
parent
222b3bb129
commit
7f652e2c17
2 changed files with 5 additions and 5 deletions
|
|
@ -373,7 +373,7 @@ static void adjustZIndexForAttributes(UICollectionViewLayoutAttributes *attribut
|
|||
}
|
||||
}
|
||||
|
||||
const CGRect frame = CGRectMake(contentInset.left + itemX,
|
||||
const CGRect frame = CGRectMake(itemX,
|
||||
itemY + insets.top,
|
||||
itemWidth,
|
||||
size.height);
|
||||
|
|
@ -393,7 +393,7 @@ static void adjustZIndexForAttributes(UICollectionViewLayoutAttributes *attribut
|
|||
}
|
||||
}
|
||||
|
||||
const CGRect headerBounds = CGRectMake(contentInset.left + insets.left,
|
||||
const CGRect headerBounds = CGRectMake(insets.left,
|
||||
CGRectGetMinY(rollingSectionBounds) - headerSize.height,
|
||||
paddedWidth,
|
||||
headerSize.height);
|
||||
|
|
|
|||
|
|
@ -582,9 +582,9 @@ XCTAssertEqual(CGRectGetHeight(expected), CGRectGetHeight(frame)); \
|
|||
]],
|
||||
]];
|
||||
XCTAssertEqual(self.collectionView.contentSize.height, 40);
|
||||
IGAssertEqualFrame([self headerForSection:0].frame, 30, 0, 40, 10);
|
||||
IGAssertEqualFrame([self cellForSection:0 item:0].frame, 30, 10, 40, 10);
|
||||
IGAssertEqualFrame([self cellForSection:0 item:1].frame, 30, 20, 40, 20);
|
||||
IGAssertEqualFrame([self headerForSection:0].frame, 0, 0, 40, 10);
|
||||
IGAssertEqualFrame([self cellForSection:0 item:0].frame, 0, 10, 40, 10);
|
||||
IGAssertEqualFrame([self cellForSection:0 item:1].frame, 0, 20, 40, 20);
|
||||
}
|
||||
|
||||
- (void)test_ {
|
||||
|
|
|
|||
Loading…
Reference in a new issue