When requerying node heights, go straight to super

This commit is contained in:
Adlai Holler
2016-09-02 11:12:51 -07:00
parent 1f61dd1576
commit 8f58cf4ff9

View File

@@ -484,9 +484,9 @@ static NSString * const kCellReuseIdentifier = @"_ASTableViewCell";
if (_ignoreNodesConstrainedWidthChange) {
_ignoreNodesConstrainedWidthChange = NO;
} else {
[self beginUpdates];
[super beginUpdates];
[_dataController relayoutAllNodes];
[self endUpdates];
[super endUpdates];
}
}
@@ -1185,10 +1185,10 @@ static NSString * const kCellReuseIdentifier = @"_ASTableViewCell";
// is the same for all cells (because there is no easy way to get that individual value before the node being assigned to a _ASTableViewCell).
// Also, in many cases, some nodes may not need to be re-measured at all, such as when user enters and then immediately leaves editing mode.
// To avoid premature optimization and making such assumption, as well as to keep ASTableView simple, re-measurement is strictly done on main.
[self beginUpdates];
[super beginUpdates];
CGSize calculatedSize = [[node measureWithSizeRange:constrainedSize] size];
node.frame = CGRectMake(0, 0, calculatedSize.width, calculatedSize.height);
[self endUpdates];
[super endUpdates];
}
}