mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-20 21:29:00 +00:00
Merge pull request #1806 from maicki/MSAddASButtonNodePreferredFrameSize
[ASButtonNode] Add support for 'preferredFrameSize' to ASButtonNode
This commit is contained in:
commit
d8efa54f21
@ -15,6 +15,7 @@
|
|||||||
#import "ASBackgroundLayoutSpec.h"
|
#import "ASBackgroundLayoutSpec.h"
|
||||||
#import "ASInsetLayoutSpec.h"
|
#import "ASInsetLayoutSpec.h"
|
||||||
#import "ASDisplayNode+Beta.h"
|
#import "ASDisplayNode+Beta.h"
|
||||||
|
#import "ASStaticLayoutSpec.h"
|
||||||
|
|
||||||
@interface ASButtonNode ()
|
@interface ASButtonNode ()
|
||||||
{
|
{
|
||||||
@ -491,9 +492,13 @@
|
|||||||
spec = [ASInsetLayoutSpec insetLayoutSpecWithInsets:contentEdgeInsets child:spec];
|
spec = [ASInsetLayoutSpec insetLayoutSpecWithInsets:contentEdgeInsets child:spec];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (CGSizeEqualToSize(self.preferredFrameSize, CGSizeZero) == NO) {
|
||||||
|
stack.sizeRange = ASRelativeSizeRangeMakeWithExactCGSize(self.preferredFrameSize);
|
||||||
|
spec = [ASStaticLayoutSpec staticLayoutSpecWithChildren:@[stack]];
|
||||||
|
}
|
||||||
|
|
||||||
if (_backgroundImageNode.image) {
|
if (_backgroundImageNode.image) {
|
||||||
spec = [ASBackgroundLayoutSpec backgroundLayoutSpecWithChild:spec
|
spec = [ASBackgroundLayoutSpec backgroundLayoutSpecWithChild:spec background:_backgroundImageNode];
|
||||||
background:_backgroundImageNode];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return spec;
|
return spec;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user