mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-24 07:05:35 +00:00
Add locking for ASStackLayoutElement and ASAbsoluteLayoutElement (#2371)
This commit is contained in:
committed by
GitHub
parent
8f8df537d2
commit
8491155fb4
@@ -115,6 +115,16 @@ do {\
|
||||
@dynamic width, height, minWidth, maxWidth, minHeight, maxHeight;
|
||||
@dynamic preferredSize, minSize, maxSize, preferredLayoutSize, minLayoutSize, maxLayoutSize;
|
||||
|
||||
@synthesize spacingBefore = _spacingBefore;
|
||||
@synthesize spacingAfter = _spacingAfter;
|
||||
@synthesize flexGrow = _flexGrow;
|
||||
@synthesize flexShrink = _flexShrink;
|
||||
@synthesize flexBasis = _flexBasis;
|
||||
@synthesize alignSelf = _alignSelf;
|
||||
@synthesize ascender = _ascender;
|
||||
@synthesize descender = _descender;
|
||||
@synthesize layoutPosition = _layoutPosition;
|
||||
|
||||
#pragma mark - Lifecycle
|
||||
|
||||
- (instancetype)initWithDelegate:(id<ASLayoutElementStyleDelegate>)delegate
|
||||
@@ -296,6 +306,12 @@ do {\
|
||||
ASLayoutElementStyleCallDelegate(ASLayoutElementStyleSpacingBeforeProperty);
|
||||
}
|
||||
|
||||
- (CGFloat)spacingBefore
|
||||
{
|
||||
ASDN::MutexLocker l(__instanceLock__);
|
||||
return _spacingBefore;
|
||||
}
|
||||
|
||||
- (void)setSpacingAfter:(CGFloat)spacingAfter
|
||||
{
|
||||
ASDN::MutexLocker l(__instanceLock__);
|
||||
@@ -303,6 +319,12 @@ do {\
|
||||
ASLayoutElementStyleCallDelegate(ASLayoutElementStyleSpacingAfterProperty);
|
||||
}
|
||||
|
||||
- (CGFloat)spacingAfter
|
||||
{
|
||||
ASDN::MutexLocker l(__instanceLock__);
|
||||
return _spacingAfter;
|
||||
}
|
||||
|
||||
- (void)setFlexGrow:(CGFloat)flexGrow
|
||||
{
|
||||
ASDN::MutexLocker l(__instanceLock__);
|
||||
@@ -310,6 +332,12 @@ do {\
|
||||
ASLayoutElementStyleCallDelegate(ASLayoutElementStyleFlexGrowProperty);
|
||||
}
|
||||
|
||||
- (CGFloat)flexGrow
|
||||
{
|
||||
ASDN::MutexLocker l(__instanceLock__);
|
||||
return _flexGrow;
|
||||
}
|
||||
|
||||
- (void)setFlexShrink:(CGFloat)flexShrink
|
||||
{
|
||||
ASDN::MutexLocker l(__instanceLock__);
|
||||
@@ -317,6 +345,12 @@ do {\
|
||||
ASLayoutElementStyleCallDelegate(ASLayoutElementStyleFlexShrinkProperty);
|
||||
}
|
||||
|
||||
- (CGFloat)flexShrink
|
||||
{
|
||||
ASDN::MutexLocker l(__instanceLock__);
|
||||
return _flexShrink;
|
||||
}
|
||||
|
||||
- (void)setFlexBasis:(ASDimension)flexBasis
|
||||
{
|
||||
ASDN::MutexLocker l(__instanceLock__);
|
||||
@@ -324,6 +358,12 @@ do {\
|
||||
ASLayoutElementStyleCallDelegate(ASLayoutElementStyleFlexBasisProperty);
|
||||
}
|
||||
|
||||
- (ASDimension)flexBasis
|
||||
{
|
||||
ASDN::MutexLocker l(__instanceLock__);
|
||||
return _flexBasis;
|
||||
}
|
||||
|
||||
- (void)setAlignSelf:(ASStackLayoutAlignSelf)alignSelf
|
||||
{
|
||||
ASDN::MutexLocker l(__instanceLock__);
|
||||
@@ -331,6 +371,12 @@ do {\
|
||||
ASLayoutElementStyleCallDelegate(ASLayoutElementStyleAlignSelfProperty);
|
||||
}
|
||||
|
||||
- (ASStackLayoutAlignSelf)alignSelf
|
||||
{
|
||||
ASDN::MutexLocker l(__instanceLock__);
|
||||
return _alignSelf;
|
||||
}
|
||||
|
||||
- (void)setAscender:(CGFloat)ascender
|
||||
{
|
||||
ASDN::MutexLocker l(__instanceLock__);
|
||||
@@ -338,6 +384,12 @@ do {\
|
||||
ASLayoutElementStyleCallDelegate(ASLayoutElementStyleAscenderProperty);
|
||||
}
|
||||
|
||||
- (CGFloat)ascender
|
||||
{
|
||||
ASDN::MutexLocker l(__instanceLock__);
|
||||
return _ascender;
|
||||
}
|
||||
|
||||
- (void)setDescender:(CGFloat)descender
|
||||
{
|
||||
ASDN::MutexLocker l(__instanceLock__);
|
||||
@@ -345,6 +397,12 @@ do {\
|
||||
ASLayoutElementStyleCallDelegate(ASLayoutElementStyleDescenderProperty);
|
||||
}
|
||||
|
||||
- (CGFloat)descender
|
||||
{
|
||||
ASDN::MutexLocker l(__instanceLock__);
|
||||
return _descender;
|
||||
}
|
||||
|
||||
#pragma mark - ASAbsoluteLayoutElement
|
||||
|
||||
- (void)setLayoutPosition:(CGPoint)layoutPosition
|
||||
@@ -354,5 +412,11 @@ do {\
|
||||
ASLayoutElementStyleCallDelegate(ASLayoutElementStyleLayoutPositionProperty);
|
||||
}
|
||||
|
||||
- (CGPoint)layoutPosition
|
||||
{
|
||||
ASDN::MutexLocker l(__instanceLock__);
|
||||
return _layoutPosition;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user