mirror of
https://github.com/HackPlan/AsyncDisplayKit.git
synced 2026-04-01 12:23:20 +08:00
- 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)
41 lines
1.2 KiB
Objective-C
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()
|
|
};
|
|
} |