mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2026-03-20 06:10:28 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user