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

@@ -18,7 +18,6 @@
#import "ASImageNode+CGExtras.h"
#import "ASInternalHelpers.h"
#import "ASLayoutNode.h"
@interface _ASImageNodeDrawParameters : NSObject
@@ -109,13 +108,13 @@
return nil;
}
- (ASLayout *)calculateLayoutThatFits:(CGSize)constrainedSize
- (ASLayout *)calculateLayoutThatFits:(ASSizeRange)constrainedSize
{
ASDN::MutexLocker l(_imageLock);
CGSize size = CGSizeZero;
if (_image)
size = _image.size;
return [ASLayout newWithNode:[ASLayoutNode new] size:size];
return [ASLayout newWithLayoutableObject:self size:ASSizeRangeClamp(constrainedSize, size)];
}
- (void)setImage:(UIImage *)image