mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2026-02-10 13:06:33 +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:
@@ -145,12 +145,12 @@
|
||||
[self.view addSubview:_textKitComponents.textView];
|
||||
}
|
||||
|
||||
- (ASLayout *)calculateLayoutThatFits:(CGSize)constrainedSize
|
||||
- (ASLayout *)calculateLayoutThatFits:(ASSizeRange)constrainedSize
|
||||
{
|
||||
ASTextKitComponents *displayedComponents = [self isDisplayingPlaceholder] ? _placeholderTextKitComponents : _textKitComponents;
|
||||
CGSize textSize = [displayedComponents sizeForConstrainedWidth:constrainedSize.width];
|
||||
CGSize finalSize = CGSizeMake(constrainedSize.width, fminf(textSize.height, constrainedSize.height));
|
||||
return [ASLayout newWithNode:[ASLayoutNode new] size:finalSize];
|
||||
CGSize textSize = [displayedComponents sizeForConstrainedWidth:constrainedSize.max.width];
|
||||
CGSize finalSize = CGSizeMake(constrainedSize.max.width, fminf(textSize.height, constrainedSize.max.height));
|
||||
return [ASLayout newWithLayoutableObject:self size:finalSize];
|
||||
}
|
||||
|
||||
- (void)layout
|
||||
|
||||
Reference in New Issue
Block a user