Fix warnings and errors, apply attributes from NSCollectionViewLayoutAttributes to view

This commit is contained in:
Gregory John Casamento 2022-03-14 04:23:08 -04:00
parent 68f1444de3
commit b7eb68b67c
2 changed files with 10 additions and 6 deletions

View file

@ -1393,10 +1393,16 @@ static NSString *placeholderItem = nil;
NSView *v = [item view];
NSCollectionViewLayoutAttributes *attrs =
[_collectionViewLayout layoutAttributesForItemAtIndexPath: p];
NSRect f = [attrs frame];
// set position of item based on currently selected layout...
[v setFrame: f];
NSRect frame = [attrs frame];
BOOL hidden = [attrs isHidden];
CGFloat alpha = [attrs alpha];
NSSize sz = [attrs size];
// set attributes of item based on currently selected layout...
frame.size = sz;
[v setFrame: frame];
[v setHidden: hidden];
[v setAlphaValue: alpha];
}
}
}

View file

@ -178,8 +178,6 @@
- (void) prepareLayout
{
[super prepareLayout];
_invalidateFlowLayoutAttributes = NO;
_invalidateFlowLayoutDelegateMetrics = NO;
}
- (NSArray *) layoutAttributesForElementsInRect: (NSRect)rect