Notify ASCellNodeDelegate even if a relayout doesn't result in a resize

If the delegate is an ASTableView, relayoutAnimation will still be considered for animation.
This commit is contained in:
Huy Nguyen
2015-10-29 21:26:06 +02:00
parent 5b8f7e978d
commit fb18e7635b
5 changed files with 11 additions and 27 deletions

View File

@@ -53,15 +53,12 @@
- (void)setNeedsLayout
{
ASDisplayNodeAssertThreadAffinity(self);
CGSize oldSize = self.calculatedSize;
ASDisplayNodeAssertThreadAffinity(self);
[super setNeedsLayout];
CGSize newSize = self.calculatedSize;
if (_delegate != nil && !CGSizeEqualToSize(oldSize, newSize)) {
if (_delegate != nil) {
ASPerformBlockOnMainThread(^{
[_delegate node:self didRelayoutToNewSize:newSize suggestedAnimation:_relayoutAnimation];
[_delegate node:self didRelayoutWithSuggestedAnimation:_relayoutAnimation];
});
}
}