Skip to content
This repository was archived by the owner on Feb 2, 2023. It is now read-only.

Commit d1c3894

Browse files
author
Scott Goodson
committed
[ASRangeControllerBeta] Add tracking of all index paths that have .interfaceState set, ensure updating.
1 parent 8a5f080 commit d1c3894

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

AsyncDisplayKit/Details/ASRangeControllerBeta.mm

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ @interface ASRangeControllerBeta ()
3737
BOOL _rangeIsValid;
3838
BOOL _queuedRangeUpdate;
3939
ASScrollDirection _scrollDirection;
40+
NSMutableSet *_allPreviousIndexPaths;
4041
}
4142

4243
@end
@@ -112,6 +113,12 @@ - (void)_updateVisibleNodeIndexPaths
112113
[allIndexPaths unionSet:displayIndexPaths];
113114
[allIndexPaths unionSet:visibleIndexPaths];
114115

116+
// Sets are magical. Add anything we had applied interfaceState to in the last update, so we can clear any
117+
// range flags it still has enabled. Most of the time, all but a few elements are equal; a large programmatic
118+
// scroll or major main thread stall could cause entirely disjoint sets, but we must visit all.
119+
[allIndexPaths unionSet:_allPreviousIndexPaths];
120+
_allPreviousIndexPaths = allIndexPaths;
121+
115122
for (NSIndexPath *indexPath in allIndexPaths) {
116123
// Before a node / indexPath is exposed to ASRangeController, ASDataController should have already measured it.
117124
// For consistency, make sure each node knows that it should measure itself if something changes.

0 commit comments

Comments
 (0)