mirror of
https://github.com/HackPlan/AsyncDisplayKit.git
synced 2026-05-16 16:01:00 +08:00
Fix to ASEnvironment
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user