mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-10 08:20:16 +00:00
scott's comments
This commit is contained in:
parent
7f6f2fed11
commit
715a678829
@ -102,7 +102,7 @@ static NSString *ASTextNodeTruncationTokenAttributeName = @"ASTextNodeTruncation
|
||||
|
||||
UILongPressGestureRecognizer *_longPressGestureRecognizer;
|
||||
|
||||
// Forwards NSLayoutManagerDelegate methods related to word kerning
|
||||
ASDN::Mutex _wordKernerLock;
|
||||
ASTextNodeWordKerner *_wordKerner;
|
||||
|
||||
}
|
||||
@ -148,8 +148,6 @@ static NSArray *DefaultLinkAttributeNames = @[ NSLinkAttributeName ];
|
||||
// on the special placeholder behavior of ASTextNode.
|
||||
_placeholderColor = ASDisplayNodeDefaultPlaceholderColor();
|
||||
_placeholderInsets = UIEdgeInsetsMake(1.0, 0.0, 1.0, 0.0);
|
||||
|
||||
_wordKerner = [[ASTextNodeWordKerner alloc] init];
|
||||
}
|
||||
|
||||
return self;
|
||||
@ -264,7 +262,7 @@ static NSArray *DefaultLinkAttributeNames = @[ NSLinkAttributeName ];
|
||||
.maximumNumberOfLines = _maximumNumberOfLines,
|
||||
.exclusionPaths = _exclusionPaths,
|
||||
.minimumScaleFactor = _minimumScaleFactor,
|
||||
.layoutManagerDelegate = _wordKerner,
|
||||
.layoutManagerDelegate = [self _wordKerner],
|
||||
};
|
||||
}
|
||||
|
||||
@ -300,6 +298,15 @@ static NSArray *DefaultLinkAttributeNames = @[ NSLinkAttributeName ];
|
||||
}
|
||||
}
|
||||
|
||||
- (ASTextNodeWordKerner *)_wordKerner
|
||||
{
|
||||
ASDN::MutexLocker l(_wordKernerLock);
|
||||
if (_wordKerner == nil) {
|
||||
_wordKerner = [[ASTextNodeWordKerner alloc] init];
|
||||
}
|
||||
return _wordKerner;
|
||||
}
|
||||
|
||||
#pragma mark - Layout and Sizing
|
||||
|
||||
- (BOOL)_needInvalidateRendererForBoundsSize:(CGSize)boundsSize
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user