@@ -616,25 +616,20 @@ - (ASLayout *)measureWithSizeRange:(ASSizeRange)constrainedSize
616616 [self cancelLayoutTransitionsInProgress ];
617617
618618 ASLayout *previousLayout = _layout;
619- ASSizeRange previousConstrainedSize = _constrainedSize;
620619 ASLayout *newLayout = [self calculateLayoutThatFits: constrainedSize];
621620
622621 if (ASHierarchyStateIncludesLayoutPending (_hierarchyState)) {
623622 _pendingLayoutTransition = [[ASLayoutTransition alloc ] initWithNode: self
624623 pendingLayout: newLayout
625- pendingConstrainedSize: constrainedSize
626- previousLayout: previousLayout
627- previousConstrainedSize: previousConstrainedSize];
624+ previousLayout: previousLayout];
628625 } else {
629626 ASLayoutTransition *layoutContext;
630627 if (self.usesImplicitHierarchyManagement ) {
631628 layoutContext = [[ASLayoutTransition alloc ] initWithNode: self
632629 pendingLayout: newLayout
633- pendingConstrainedSize: constrainedSize
634- previousLayout: previousLayout
635- previousConstrainedSize: previousConstrainedSize];
630+ previousLayout: previousLayout];
636631 }
637- [self applyLayout: newLayout constrainedSize: constrainedSize layoutContext: layoutContext];
632+ [self applyLayout: newLayout layoutContext: layoutContext];
638633 [self _completeLayoutCalculation ];
639634 }
640635
@@ -658,7 +653,7 @@ - (BOOL)shouldMeasureWithSizeRange:(ASSizeRange)constrainedSize
658653 // only calculate the size if
659654 // - we haven't already
660655 // - the constrained size range is different
661- return (!_flags.isMeasured || !ASSizeRangeEqualToSizeRange (constrainedSize, _constrainedSize ));
656+ return (!_flags.isMeasured || !ASSizeRangeEqualToSizeRange (constrainedSize, _layout. constrainedSizeRange ));
662657}
663658
664659#pragma mark - Layout Transition
@@ -667,9 +662,8 @@ - (void)transitionLayoutWithAnimation:(BOOL)animated
667662 shouldMeasureAsync : (BOOL )shouldMeasureAsync
668663 measurementCompletion : (void (^)())completion
669664{
670- ASSizeRange currentConstrainedSize = _constrainedSize;
671665 [self invalidateCalculatedLayout ];
672- [self transitionLayoutWithSizeRange: currentConstrainedSize
666+ [self transitionLayoutWithSizeRange: _layout.constrainedSizeRange
673667 animated: animated
674668 shouldMeasureAsync: shouldMeasureAsync
675669 measurementCompletion: completion];
@@ -732,8 +726,7 @@ - (void)transitionLayoutWithSizeRange:(ASSizeRange)constrainedSize
732726 }
733727
734728 ASLayout *previousLayout = _layout;
735- ASSizeRange previousConstrainedSize = _constrainedSize;
736- [self applyLayout: newLayout constrainedSize: constrainedSize layoutContext: nil ];
729+ [self applyLayout: newLayout layoutContext: nil ];
737730
738731 ASDisplayNodePerformBlockOnEverySubnode (self, ^(ASDisplayNode * _Nonnull node) {
739732 [node applyPendingLayoutContext ];
@@ -749,9 +742,7 @@ - (void)transitionLayoutWithSizeRange:(ASSizeRange)constrainedSize
749742
750743 _pendingLayoutTransition = [[ASLayoutTransition alloc ] initWithNode: self
751744 pendingLayout: newLayout
752- pendingConstrainedSize: constrainedSize
753- previousLayout: previousLayout
754- previousConstrainedSize: previousConstrainedSize];
745+ previousLayout: previousLayout];
755746 [_pendingLayoutTransition applySubnodeInsertions ];
756747
757748 _transitionContext = [[_ASTransitionContext alloc ] initWithAnimation: animated
@@ -1032,7 +1023,6 @@ - (void)__setNeedsLayout
10321023 return ;
10331024 }
10341025
1035- ASSizeRange oldConstrainedSize = _constrainedSize;
10361026 [self invalidateCalculatedLayout ];
10371027
10381028 if (_supernode) {
@@ -1045,7 +1035,7 @@ - (void)__setNeedsLayout
10451035 }
10461036
10471037 // This is the root node. Trigger a full measurement pass on *current* thread. Old constrained size is re-used.
1048- [self measureWithSizeRange: oldConstrainedSize ];
1038+ [self measureWithSizeRange: _layout.constrainedSizeRange ];
10491039
10501040 CGRect oldBounds = self.bounds ;
10511041 CGSize oldSize = oldBounds.size ;
@@ -2014,7 +2004,7 @@ - (CGSize)calculatedSize
20142004- (ASSizeRange)constrainedSizeForCalculatedLayout
20152005{
20162006 ASDN::MutexLocker l (_propertyLock);
2017- return _constrainedSize ;
2007+ return _layout. constrainedSizeRange ;
20182008}
20192009
20202010- (void )setLayoutSpecBlock : (ASLayoutSpecBlock)layoutSpecBlock
@@ -2400,15 +2390,12 @@ - (void)applyPendingLayoutContext
24002390{
24012391 ASDN::MutexLocker l (_propertyLock);
24022392 if (_pendingLayoutTransition) {
2403- [self applyLayout: _pendingLayoutTransition.pendingLayout
2404- constrainedSize: _pendingLayoutTransition.pendingConstrainedSize
2405- layoutContext: _pendingLayoutTransition];
2393+ [self applyLayout: _pendingLayoutTransition.pendingLayout layoutContext: _pendingLayoutTransition];
24062394 _pendingLayoutTransition = nil ;
24072395 }
24082396}
24092397
24102398- (void )applyLayout : (ASLayout *)layout
2411- constrainedSize : (ASSizeRange)constrainedSize
24122399 layoutContext : (ASLayoutTransition *)layoutContext
24132400{
24142401 ASDN::MutexLocker l (_propertyLock);
@@ -2418,7 +2405,6 @@ - (void)applyLayout:(ASLayout *)layout
24182405 ASDisplayNodeAssertTrue (layout.size .width >= 0.0 );
24192406 ASDisplayNodeAssertTrue (layout.size .height >= 0.0 );
24202407
2421- _constrainedSize = constrainedSize;
24222408 _flags.isMeasured = YES ;
24232409
24242410 if (self.usesImplicitHierarchyManagement && layoutContext != nil ) {
0 commit comments