mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-24 07:05:35 +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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user