Merge pull request #1767 from facebook/AHPercentToFraction

[ASRelativeDimensionType] Replace "percent" with "fraction" Where Appropriate
This commit is contained in:
Hannah Troisi
2016-08-11 20:33:34 -07:00
committed by Hannah Trosi
parent 27585ff123
commit de99951b4f
14 changed files with 30 additions and 30 deletions

View File

@@ -330,7 +330,7 @@ static NSArray *defaultSubnodesWithSameSize(CGSize subnodeSize, BOOL flex)
subnode2.staticSize = {50, 50};
ASRatioLayoutSpec *child1 = [ASRatioLayoutSpec ratioLayoutSpecWithRatio:1.5 child:subnode1];
child1.flexBasis = ASRelativeDimensionMakeWithPercent(1);
child1.flexBasis = ASRelativeDimensionMakeWithFraction(1);
child1.flexGrow = YES;
child1.flexShrink = YES;
@@ -508,7 +508,7 @@ static NSArray *defaultSubnodesWithSameSize(CGSize subnodeSize, BOOL flex)
[self testStackLayoutSpecWithStyle:style sizeRange:kOverflowSize subnodes:subnodes identifier:@"overflow"];
}
- (void)testPercentageFlexBasisResolvesAgainstParentSize
- (void)testFractionalFlexBasisResolvesAgainstParentSize
{
ASStackLayoutSpecStyle style = {.direction = ASStackLayoutDirectionHorizontal};
@@ -520,7 +520,7 @@ static NSArray *defaultSubnodesWithSameSize(CGSize subnodeSize, BOOL flex)
// This should override the intrinsic size of 50pts and instead compute to 50% = 100pts.
// The result should be that the red box is twice as wide as the blue and gree boxes after flexing.
((ASStaticSizeDisplayNode *)subnodes[0]).flexBasis = ASRelativeDimensionMakeWithPercent(0.5);
((ASStaticSizeDisplayNode *)subnodes[0]).flexBasis = ASRelativeDimensionMakeWithFraction(0.5);
static ASSizeRange kSize = {{200, 0}, {200, INFINITY}};
[self testStackLayoutSpecWithStyle:style sizeRange:kSize subnodes:subnodes identifier:nil];