Files
AsyncDisplayKit/AsyncDisplayKit/Details/ASEnvironment.m
Michael Schneider 4e757f0969 General improvements
- Refactor naming of ASEnvironmentCollection to ASEnvironmentState
- Remove struct pointers
- Move ASEnvironmentStatePropagation to a enum class
- Move merge functions to pure functions
- Move ASLayoutOptionsForwarding and ASLayoutableExtensibility into ASLayoutSpec and ASDisplayNode
- Remove ASLayoutableSetValuesForLayoutable and move into explicit classes (ASDisplayNode, ASTextNode)
2016-03-31 20:43:20 -07:00

41 lines
1.2 KiB
Objective-C

/*
* Copyright (c) 2014-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
#import "ASEnvironment.h"
ASEnvironmentLayoutOptionsState ASEnvironmentLayoutOptionsStateCreate()
{
return (ASEnvironmentLayoutOptionsState) {
.spacingBefore = 0,
.flexBasis = ASRelativeDimensionUnconstrained,
.alignSelf = ASStackLayoutAlignSelfAuto,
.sizeRange = ASRelativeSizeRangeMake(ASRelativeSizeMakeWithCGSize(CGSizeZero), ASRelativeSizeMakeWithCGSize(CGSizeZero)),
.layoutPosition = CGPointZero
};
}
ASEnvironmentHierarchyState ASEnvironmentHierarchyStateCreate()
{
return (ASEnvironmentHierarchyState) {
.rasterized = NO,
.rangeManaged = NO,
.transitioningSupernodes = NO,
.layoutPending = NO
};
}
ASEnvironmentState ASEnvironmentStateCreate()
{
return (ASEnvironmentState) {
.hierarchyState = ASEnvironmentHierarchyStateCreate(),
.layoutOptionsState = ASEnvironmentLayoutOptionsStateCreate()
};
}