We need to invalidate the layout before the transition does start

This commit is contained in:
Michael Schneider
2016-11-19 06:58:07 -08:00
parent 66ad9bd5e3
commit 8d5fc9efe3

View File

@@ -832,7 +832,6 @@ static ASDisplayNodeMethodOverrides GetASDisplayNodeMethodOverrides(Class c)
shouldMeasureAsync:(BOOL)shouldMeasureAsync
measurementCompletion:(void(^)())completion
{
[self setNeedsLayout];
[self transitionLayoutWithSizeRange:[self _locked_constrainedSizeForLayoutPass]
animated:animated
shouldMeasureAsync:shouldMeasureAsync
@@ -858,6 +857,9 @@ static ASDisplayNodeMethodOverrides GetASDisplayNodeMethodOverrides(Class c)
ASDisplayNodeAssert(ASHierarchyStateIncludesLayoutPending(_hierarchyState) == NO, @"Can't start a transition when one of the supernodes is performing one.");
}
// Invalidate the current layout to be able to measure a new layout based onthe given constrained size
[self setNeedsLayout];
// Every new layout transition has a transition id associated to check in subsequent transitions for cancelling
int32_t transitionID = [self _startNewTransition];