diff --git a/AsyncDisplayKit/ASLayoutSpec+Debug.m b/AsyncDisplayKit/ASLayoutSpec+Debug.m index 8923593f..e6268cb6 100644 --- a/AsyncDisplayKit/ASLayoutSpec+Debug.m +++ b/AsyncDisplayKit/ASLayoutSpec+Debug.m @@ -37,9 +37,11 @@ insetSpec.neverShouldVisualize = YES; // propogate child's layoutSpec properties to the inset that we are adding - insetSpec.flexGrow = _layoutSpec.flexGrow; - insetSpec.flexShrink = _layoutSpec.flexShrink; - insetSpec.alignSelf = _layoutSpec.alignSelf; +// insetSpec.flexGrow = _layoutSpec.flexGrow; +// insetSpec.flexShrink = _layoutSpec.flexShrink; +// insetSpec.alignSelf = _layoutSpec.alignSelf; + + NSLog(@"%@: vizNode = %d, child = %d", self, insetSpec.flexGrow, _layoutSpec.flexGrow); return insetSpec; } diff --git a/AsyncDisplayKit/Private/ASEnvironmentInternal.mm b/AsyncDisplayKit/Private/ASEnvironmentInternal.mm index 83ea991b..39f5a996 100644 --- a/AsyncDisplayKit/Private/ASEnvironmentInternal.mm +++ b/AsyncDisplayKit/Private/ASEnvironmentInternal.mm @@ -15,7 +15,7 @@ //#define LOG(...) NSLog(__VA_ARGS__) #define LOG(...) -#define AS_SUPPORT_PROPAGATION NO +#define AS_SUPPORT_PROPAGATION YES BOOL ASEnvironmentStatePropagationEnabled() { @@ -139,6 +139,9 @@ ASEnvironmentState ASEnvironmentMergeObjectAndState(ASEnvironmentState environme if (parentLayoutOptionsState.flexGrow == defaultState.flexGrow) { parentLayoutOptionsState.flexGrow = layoutOptionsState.flexGrow; } + if (parentLayoutOptionsState.flexShrink == defaultState.flexShrink) { + parentLayoutOptionsState.flexShrink = layoutOptionsState.flexShrink; + } if (ASRelativeDimensionEqualToRelativeDimension(parentLayoutOptionsState.flexBasis, defaultState.flexBasis)) { parentLayoutOptionsState.flexBasis = layoutOptionsState.flexBasis; } diff --git a/examples/ASLayoutSpecPlayground/Sample/PlaygroundNode.m b/examples/ASLayoutSpecPlayground/Sample/PlaygroundNode.m index 0a871fce..f19fe104 100644 --- a/examples/ASLayoutSpecPlayground/Sample/PlaygroundNode.m +++ b/examples/ASLayoutSpecPlayground/Sample/PlaygroundNode.m @@ -64,6 +64,8 @@ _photoDescriptionLabel = [[ASTextNode alloc] init]; _photoDescriptionLabel.attributedString = [self descriptionAttributedStringWithFontSize:FONT_SIZE]; _photoDescriptionLabel.maximumNumberOfLines = 3; + + } return self; @@ -95,7 +97,8 @@ ASLayoutSpec *spacer = [[ASLayoutSpec alloc] init]; spacer.flexGrow = YES; - spacer.flexShrink = YES; + spacer.flexShrink = YES; // FIXME: this overrides stuff :) THIS IS A SYSTEMIC ISSUE - can we make layoutSpecThatFits only run once? cache layoutSpec, just use new constrainedSize, don't put properties in layoutSpecThatFits + // separate the idea of laying out and rerunning with new constrainedSize ASStackLayoutSpec *headerStack = [ASStackLayoutSpec horizontalStackLayoutSpec]; headerStack.alignItems = ASStackLayoutAlignItemsCenter; // center items vertically in horizontal stack