Introduce ASLayoutable and eliminate ASCompositeNode:

- Both ASDisplayNode and ASLayoutNode conforms to this protocol.
- ASDisplayNode can be embeded directly into layout graph.
- Eliminate ASCompositeNode.
- Fix ASStaticSizeDisplayNode not recpect min constrained size.
- Updated tests.
This commit is contained in:
Huy Nguyen
2015-06-26 08:41:51 +07:00
parent 697b9f4c3c
commit f588bceb4d
40 changed files with 262 additions and 363 deletions

View File

@@ -63,11 +63,8 @@ static NSString *nameForInsets(UIEdgeInsets insets)
ASLayoutNode *layoutNode =
[ASBackgroundLayoutNode
newWithNode:
[ASInsetLayoutNode
newWithInsets:insets
node:[ASCompositeNode newWithDisplayNode:foregroundNode]]
background:[ASCompositeNode newWithDisplayNode:backgroundNode]];
newWithChild:[ASInsetLayoutNode newWithInsets:insets child:foregroundNode]
background:backgroundNode];
static ASSizeRange kVariableSize = {{0, 0}, {300, 300}};
[self testLayoutNode:layoutNode
@@ -87,11 +84,8 @@ static NSString *nameForInsets(UIEdgeInsets insets)
ASLayoutNode *layoutNode =
[ASBackgroundLayoutNode
newWithNode:
[ASInsetLayoutNode
newWithInsets:insets
node:[ASCompositeNode newWithDisplayNode:foregroundNode]]
background:[ASCompositeNode newWithDisplayNode:backgroundNode]];
newWithChild:[ASInsetLayoutNode newWithInsets:insets child:foregroundNode]
background:backgroundNode];
static ASSizeRange kFixedSize = {{300, 300}, {300, 300}};
[self testLayoutNode:layoutNode
@@ -112,11 +106,8 @@ static NSString *nameForInsets(UIEdgeInsets insets)
ASLayoutNode *layoutNode =
[ASBackgroundLayoutNode
newWithNode:
[ASInsetLayoutNode
newWithInsets:insets
node:[ASCompositeNode newWithDisplayNode:foregroundNode]]
background:[ASCompositeNode newWithDisplayNode:backgroundNode]];
newWithChild:[ASInsetLayoutNode newWithInsets:insets child:foregroundNode]
background:backgroundNode];
static ASSizeRange kFixedSize = {{300, 300}, {300, 300}};
[self testLayoutNode:layoutNode