Update visibleItems when arranging items

This commit is contained in:
Gregory John Casamento 2022-06-30 23:30:03 -04:00
parent 04b0a15526
commit 9c0f4ed731
2 changed files with 4 additions and 1 deletions

View file

@ -437,7 +437,7 @@ APPKIT_EXPORT_CLASS
NSCollectionViewLayout *_collectionViewLayout;
// Managing items
NSArray *_visibleItems;
NSMutableArray *_visibleItems;
NSSet *_indexPathsForVisibleItems;
NSDictionary *_visibleSupplementaryViews;
NSSet *_indexPathsForSupplementaryElementsOfKind;

View file

@ -1382,6 +1382,8 @@ static NSString *placeholderItem = nil;
if (item != nil)
{
NSView *v = [item view];
[_visibleItems addObject: item];
if (_collectionViewLayout)
{
NSCollectionViewLayoutAttributes *attrs =
@ -1426,6 +1428,7 @@ static NSString *placeholderItem = nil;
NSInteger ns = [self numberOfSections];
NSInteger cs = 0;
[_visibleItems removeAllObjects];
NSLog(@"reloading data... number of sections = %ld, %@", ns, _collectionViewLayout);
[_collectionViewLayout prepareLayout];
for (cs = 0; cs < ns; cs++)