diff --git a/AsyncDisplayKit/ASDisplayNode.mm b/AsyncDisplayKit/ASDisplayNode.mm index 2000f87de0..fa8855110c 100644 --- a/AsyncDisplayKit/ASDisplayNode.mm +++ b/AsyncDisplayKit/ASDisplayNode.mm @@ -2164,11 +2164,9 @@ void recursivelyTriggerDisplayForLayer(CALayer *layer, BOOL shouldBlock) [self __layoutSublayouts]; } else { // Assume that _layout was flattened and is 1-level deep. - CGRect subnodeFrame = CGRectZero; for (ASLayout *subnodeLayout in _layout.sublayouts) { ASDisplayNodeAssert([_subnodes containsObject:subnodeLayout.layoutableObject], @"Sublayouts must only contain subnodes' layout. self = %@, subnodes = %@", self, _subnodes); - subnodeFrame = [self _adjustedFrameForLayout:subnodeLayout]; - ((ASDisplayNode *)subnodeLayout.layoutableObject).frame = subnodeFrame; + ((ASDisplayNode *)subnodeLayout.layoutableObject).frame = [subnodeLayout frame]; } } } @@ -2176,38 +2174,10 @@ void recursivelyTriggerDisplayForLayer(CALayer *layer, BOOL shouldBlock) - (void)__layoutSublayouts { for (ASLayout *subnodeLayout in _layout.sublayouts) { - ((ASDisplayNode *)subnodeLayout.layoutableObject).frame = [self _adjustedFrameForLayout:subnodeLayout]; + ((ASDisplayNode *)subnodeLayout.layoutableObject).frame = [subnodeLayout frame]; } } -- (CGRect)_adjustedFrameForLayout:(ASLayout *)layout -{ - CGRect subnodeFrame = CGRectZero; - CGPoint adjustedOrigin = layout.position; - if (isfinite(adjustedOrigin.x) == NO) { - ASDisplayNodeAssert(0, @"subnodeLayout has an invalid position"); - adjustedOrigin.x = 0; - } - if (isfinite(adjustedOrigin.y) == NO) { - ASDisplayNodeAssert(0, @"subnodeLayout has an invalid position"); - adjustedOrigin.y = 0; - } - subnodeFrame.origin = adjustedOrigin; - - CGSize adjustedSize = layout.size; - if (isfinite(adjustedSize.width) == NO) { - ASDisplayNodeAssert(0, @"subnodeLayout has an invalid size"); - adjustedSize.width = 0; - } - if (isfinite(adjustedSize.height) == NO) { - ASDisplayNodeAssert(0, @"subnodeLayout has an invalid position"); - adjustedSize.height = 0; - } - subnodeFrame.size = adjustedSize; - - return subnodeFrame; -} - - (void)displayWillStart { // in case current node takes longer to display than it's subnodes, treat it as a dependent node diff --git a/AsyncDisplayKit/ASViewController.m b/AsyncDisplayKit/ASViewController.m index b626c7169c..78a2bac5e7 100644 --- a/AsyncDisplayKit/ASViewController.m +++ b/AsyncDisplayKit/ASViewController.m @@ -50,7 +50,6 @@ - (void)viewWillLayoutSubviews { [super viewWillLayoutSubviews]; - [_node measureWithSizeRange:[self nodeConstrainedSize]]; } - (void)viewDidLayoutSubviews diff --git a/AsyncDisplayKit/Details/_ASDisplayLayer.mm b/AsyncDisplayKit/Details/_ASDisplayLayer.mm index 24ab6b0d0e..110336be97 100644 --- a/AsyncDisplayKit/Details/_ASDisplayLayer.mm +++ b/AsyncDisplayKit/Details/_ASDisplayLayer.mm @@ -85,7 +85,7 @@ } - (void)layoutSublayers -{ +{ [super layoutSublayers]; ASDisplayNode *node = self.asyncdisplaykit_node; diff --git a/AsyncDisplayKit/Layout/ASLayout.h b/AsyncDisplayKit/Layout/ASLayout.h index 3dffdf227a..073e2a6a11 100644 --- a/AsyncDisplayKit/Layout/ASLayout.h +++ b/AsyncDisplayKit/Layout/ASLayout.h @@ -124,6 +124,7 @@ extern BOOL CGPointIsNull(CGPoint point); /** * @abstract Returns a valid frame for the current layout computed with the size and position. + * @discussion Clamps the layout's origin or position to 0 if any of the calculated values are infinite. */ - (CGRect)frame; diff --git a/AsyncDisplayKit/Private/ASDisplayNodeInternal.h b/AsyncDisplayKit/Private/ASDisplayNodeInternal.h index 336069e62c..b96a8143fe 100644 --- a/AsyncDisplayKit/Private/ASDisplayNodeInternal.h +++ b/AsyncDisplayKit/Private/ASDisplayNodeInternal.h @@ -149,11 +149,6 @@ FOUNDATION_EXPORT NSString * const ASRenderingEngineDidDisplayNodesScheduledBefo - (void)__layout; - (void)__setSupernode:(ASDisplayNode *)supernode; -/** - Clamps the layout's origin or position to 0 if any of the calculated values are infinite. - */ -- (CGRect)_adjustedFrameForLayout:(ASLayout *)layout; - // Private API for helper functions / unit tests. Use ASDisplayNodeDisableHierarchyNotifications() to control this. - (BOOL)__visibilityNotificationsDisabled; - (BOOL)__selfOrParentHasVisibilityNotificationsDisabled;